aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/macgui/macfontmanager.cpp20
-rw-r--r--graphics/macgui/macfontmanager.h8
2 files changed, 24 insertions, 4 deletions
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 7bdb8a937e..03fcb41f91 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -56,7 +56,7 @@ void MacFontManager::loadFonts() {
Common::String fontName;
if (font->getFamilyName() && *font->getFamilyName()) {
- fontName = Common::String::format("%s-%d", font->getFamilyName(), font->getFontSize());
+ fontName = Common::String::format("%s-%s-%d", font->getFamilyName(), font->getFontSlant(), font->getFontSize());
} else { // Get it from the file name
fontName = (*it)->getName();
@@ -147,13 +147,27 @@ static const char *const fontNames[] = {
"New Century Schoolbook"
};
-const char *MacFontManager::getFontName(int id, int size) {
+const char *MacFontManager::getFontName(int id, int size, int slant) {
static char name[128];
+ const char *sslant;
+
+ switch (slant) {
+ case kMacFontItalic:
+ sslant = "I";
+ break;
+ case kMacFontBold:
+ sslant = "B";
+ break;
+ case kMacFontRegular:
+ default:
+ sslant = "R";
+ break;
+ }
if (id > ARRAYSIZE(fontNames))
return NULL;
- snprintf(name, 128, "%s-%d", fontNames[id], size);
+ snprintf(name, 128, "%s-%s-%d", fontNames[id], sslant, size);
return name;
}
diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h
index fab4ce9ea1..568c1530c0 100644
--- a/graphics/macgui/macfontmanager.h
+++ b/graphics/macgui/macfontmanager.h
@@ -31,6 +31,12 @@ enum {
kMacFontChicago = 0
};
+enum {
+ kMacFontRegular,
+ kMacFontBold,
+ kMacFontItalic
+};
+
class MacFont {
public:
MacFont(int id = kMacFontChicago, int size = 12, FontManager::FontUsage fallback = Graphics::FontManager::kBigGUIFont) {
@@ -79,7 +85,7 @@ private:
* @param size size of the font
* @return the font name or NULL if ID goes beyond the mapping
*/
- const char *getFontName(int id, int size);
+ const char *getFontName(int id, int size, int slant = kMacFontRegular);
private:
bool _builtInFonts;