diff options
author | Eugene Sandulenko | 2016-08-03 17:28:15 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 17:28:15 +0200 |
commit | 7c12e80552af036d8029b6fc197403e25a879e66 (patch) | |
tree | 8e7bc98c5ac3a4f4d4db00b93ff5a08f05d8f2c5 | |
parent | 01a240ca815d9b41b7ab903a4077ae11bb98e77a (diff) | |
download | scummvm-rg350-7c12e80552af036d8029b6fc197403e25a879e66.tar.gz scummvm-rg350-7c12e80552af036d8029b6fc197403e25a879e66.tar.bz2 scummvm-rg350-7c12e80552af036d8029b6fc197403e25a879e66.zip |
WAGE/GRAPHICS: Move standard Mac font mapping to gui/
-rw-r--r-- | engines/wage/entities.cpp | 55 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 51 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.h | 7 |
3 files changed, 65 insertions, 48 deletions
diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index 28a708b0c3..77ab2659af 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -48,6 +48,7 @@ #include "wage/wage.h" #include "wage/entities.h" #include "wage/design.h" +#include "wage/gui.h" #include "wage/script.h" #include "wage/world.h" @@ -156,55 +157,13 @@ void Scene::paint(Graphics::ManagedSurface *surface, int x, int y) { } } -// Source: Apple IIGS Technical Note #41, "Font Family Numbers" -// http://apple2.boldt.ca/?page=til/tn.iigs.041 -static const char *const fontNames[] = { - "Chicago", // system font - "Geneva", // application font - "New York", - "Geneva", - - "Monaco", - "Venice", - "London", - "Athens", - - "San Francisco", - "Toronto", - NULL, - "Cairo", - "Los Angeles", // 12 - - "Zapf Dingbats", - "Bookman", - "Helvetica Narrow", - "Palatino", - NULL, - "Zapf Chancery", - NULL, - - "Times", // 20 - "Helvetica", - "Courier", - "Symbol", - "Taliesin", // mobile? - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, // 30 - NULL, - NULL, - "Avant Garde", - "New Century Schoolbook" -}; - const char *Scene::getFontName() { - if (_fontType >= 0 && _fontType < ARRAYSIZE(fontNames) && fontNames[_fontType] != NULL) { - return fontNames[_fontType]; - } - return "Unknown"; + const char *name = ((WageEngine *)g_engine)->_gui->_wm.getFontName(_fontType); + + if (!name) + return "Unknown"; + + return name; } Designed *Scene::lookUpEntity(int x, int y) { diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 9d3b729661..516eb84bf8 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -408,6 +408,57 @@ const Graphics::Font *MacWindowManager::getFont(const char *name, Graphics::Font return font; } +// Source: Apple IIGS Technical Note #41, "Font Family Numbers" +// http://apple2.boldt.ca/?page=til/tn.iigs.041 +static const char *const fontNames[] = { + "Chicago", // system font + "Geneva", // application font + "New York", + "Geneva", + + "Monaco", + "Venice", + "London", + "Athens", + + "San Francisco", + "Toronto", + NULL, + "Cairo", + "Los Angeles", // 12 + + "Zapf Dingbats", + "Bookman", + "Helvetica Narrow", + "Palatino", + NULL, + "Zapf Chancery", + NULL, + + "Times", // 20 + "Helvetica", + "Courier", + "Symbol", + "Taliesin", // mobile? + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, // 30 + NULL, + NULL, + "Avant Garde", + "New Century Schoolbook" +}; + +const char *MacWindowManager::getFontName(int id) { + if (id > ARRAYSIZE(fontNames)) + return NULL; + + return fontNames[id]; +} + ///////////////// // Cursor stuff ///////////////// diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index 22731a142e..3c1d89ddde 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -116,6 +116,13 @@ public: const Font *getFont(const char *name, FontManager::FontUsage fallback); /** + * Return font name from standard ID + * @param id ID of the font + * @return the font name or NULL if ID goes beyond the mapping + */ + const char *getFontName(int id); + + /** * Create a window with the given parameters. * Note that this method allocates the necessary memory for the window. * @param scrollable True if the window has to be scrollable. |