[Scummvm-cvs-logs] scummvm master -> 7c12e80552af036d8029b6fc197403e25a879e66
sev-
sev at scummvm.org
Wed Aug 3 17:28:49 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7c12e80552 WAGE/GRAPHICS: Move standard Mac font mapping to gui/
Commit: 7c12e80552af036d8029b6fc197403e25a879e66
https://github.com/scummvm/scummvm/commit/7c12e80552af036d8029b6fc197403e25a879e66
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-03T17:28:15+02:00
Commit Message:
WAGE/GRAPHICS: Move standard Mac font mapping to gui/
Changed paths:
engines/wage/entities.cpp
graphics/macgui/macwindowmanager.cpp
graphics/macgui/macwindowmanager.h
diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp
index 28a708b..77ab265 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 9d3b729..516eb84 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 22731a1..3c1d89d 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.
More information about the Scummvm-git-logs
mailing list