diff options
-rw-r--r-- | graphics/fontman.cpp | 12 | ||||
-rw-r--r-- | graphics/fontman.h | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp index 1827cb69aa..808dbafa1a 100644 --- a/graphics/fontman.cpp +++ b/graphics/fontman.cpp @@ -57,7 +57,19 @@ FontManager::~FontManager() { g_consolefont = 0; } +const char *builtinFontNames[] = { + "builtinOSD", + "builtinConsole", + "builtinGUI", + "builtinBigGUI", + 0 +}; + const Font *FontManager::getFontByName(const Common::String &name) const { + for (int i = 0; builtinFontNames[i]; i++) + if (!strcmp(name.c_str(), builtinFontNames[i])) + return getFontByUsage((FontUsage)i); + if (!_fontMap.contains(name)) return 0; return _fontMap[name]; diff --git a/graphics/fontman.h b/graphics/fontman.h index 9896fad38c..7871f32ba9 100644 --- a/graphics/fontman.h +++ b/graphics/fontman.h @@ -38,10 +38,10 @@ namespace Graphics { class FontManager : public Common::Singleton<FontManager> { public: enum FontUsage { - kOSDFont, - kConsoleFont, - kGUIFont, - kBigGUIFont + kOSDFont = 0, + kConsoleFont = 1, + kGUIFont = 2, + kBigGUIFont = 3 }; /** |