diff options
Diffstat (limited to 'graphics/fontman.cpp')
-rw-r--r-- | graphics/fontman.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp index 1827cb69aa..c6972cfaab 100644 --- a/graphics/fontman.cpp +++ b/graphics/fontman.cpp @@ -57,7 +57,29 @@ FontManager::~FontManager() { g_consolefont = 0; } +const struct { + const char *name; + FontManager::FontUsage id; +} builtinFontNames[] = { + { "builtinOSD", FontManager::kOSDFont }, + { "builtinConsole", FontManager::kConsoleFont }, + { "fixed5x8.bdf", FontManager::kConsoleFont }, + { "fixed5x8-iso-8859-1.bdf", FontManager::kConsoleFont }, + { "fixed5x8-ascii.bdf", FontManager::kConsoleFont }, + { "clR6x12.bdf", FontManager::kGUIFont }, + { "clR6x12-iso-8859-1.bdf", FontManager::kGUIFont }, + { "clR6x12-ascii.bdf", FontManager::kGUIFont }, + { "helvB12.bdf", FontManager::kBigGUIFont }, + { "helvB12-iso-8859-1.bdf", FontManager::kBigGUIFont }, + { "helvB12-ascii.bdf", FontManager::kBigGUIFont }, + { 0, FontManager::kOSDFont } +}; + const Font *FontManager::getFontByName(const Common::String &name) const { + for (int i = 0; builtinFontNames[i].name; i++) + if (!scumm_stricmp(name.c_str(), builtinFontNames[i].name)) + return getFontByUsage(builtinFontNames[i].id); + if (!_fontMap.contains(name)) return 0; return _fontMap[name]; |