diff options
| author | stevenhoefel | 2017-01-14 15:02:58 +1100 |
|---|---|---|
| committer | stevenhoefel | 2017-01-14 15:02:58 +1100 |
| commit | aecafd473cbb0f7424567b5cac9738b56187aa48 (patch) | |
| tree | d8b77b4ae663e2f21ce921cb80a89acaa6519ddd /graphics | |
| parent | 4f1cbddbc3533059c05e760eedcaee7bb9b6936e (diff) | |
| download | scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.tar.gz scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.tar.bz2 scummvm-rg350-aecafd473cbb0f7424567b5cac9738b56187aa48.zip | |
DIRECTOR: Load fonts by name if exists from map.
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/macgui/macfontmanager.cpp | 7 | ||||
| -rw-r--r-- | graphics/macgui/macfontmanager.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp index 21f9c08160..c6e8d7e4a7 100644 --- a/graphics/macgui/macfontmanager.cpp +++ b/graphics/macgui/macfontmanager.cpp @@ -207,6 +207,13 @@ const char *MacFontManager::getFontName(MacFont &font) { return getFontName(font.getId(), font.getSize(), font.getSlant()); } +int MacFontManager::getFontIdByName(Common::String name) { + for (int f = 0; f < ARRAYSIZE(fontNames); f++) + if (fontNames[f] != NULL && strcmp(fontNames[f], name.c_str()) == 0) + return f; + return 1; +} + void MacFontManager::generateFontSubstitute(MacFont &macFont) { Common::String name; diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h index 61c050b1cf..c098d797ed 100644 --- a/graphics/macgui/macfontmanager.h +++ b/graphics/macgui/macfontmanager.h @@ -118,6 +118,7 @@ public: */ const char *getFontName(int id, int size, int slant = kMacFontRegular); const char *getFontName(MacFont &font); + int getFontIdByName(Common::String name); private: void loadFonts(); |
