diff options
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 9e40c368dc..f0f821d313 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -347,15 +347,20 @@ void MacWindowManager::loadFonts() { delete stream; - Common::String fontName = (*it)->getName(); - - // Trim the .bdf extension - for (int i = fontName.size() - 1; i >= 0; --i) { - if (fontName[i] == '.') { - while ((uint)i < fontName.size()) { - fontName.deleteLastChar(); + Common::String fontName; + if (font->getFaceName() && *font->getFaceName()) { + fontName = font->getFaceName(); + } else { // Get it from the file name + fontName = (*it)->getName(); + + // Trim the .bdf extension + for (int i = fontName.size() - 1; i >= 0; --i) { + if (fontName[i] == '.') { + while ((uint)i < fontName.size()) { + fontName.deleteLastChar(); + } + break; } - break; } } |