aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/ThemeEngine.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 867960cad0..4e91768711 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1466,6 +1466,11 @@ DrawData ThemeEngine::parseDrawDataId(const Common::String &name) const {
const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filename, const Common::String &charset, const int pointsize, Common::String &name) {
#ifdef USE_FREETYPE2
+#ifdef USE_TRANSLATION
+ const uint32 *mapping = TransMan.getCharsetMapping();
+#else
+ const uint32 *mapping = 0;
+#endif
name = Common::String::format("%s-%s@%d", filename.c_str(), charset.c_str(), pointsize);
// Try already loaded fonts.
@@ -1479,19 +1484,18 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena
for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
Common::SeekableReadStream *stream = (*i)->createReadStream();
if (stream) {
- font = Graphics::loadTTFFont(*stream, pointsize, Graphics::kTTFSizeModeCharacter, 0, Graphics::kTTFRenderModeLight,
-#ifdef USE_TRANSLATION
- TransMan.getCharsetMapping()
-#else
- 0
-#endif
- );
+ font = Graphics::loadTTFFont(*stream, pointsize, Graphics::kTTFSizeModeCharacter, 0, Graphics::kTTFRenderModeLight, mapping);
delete stream;
if (font)
return font;
}
}
+
+ // Try loading the font from the common fonts archive.
+ font = Graphics::loadTTFFontFromArchive(filename, pointsize, Graphics::kTTFSizeModeCharacter, 0, Graphics::kTTFRenderModeLight, mapping);
+ if (font)
+ return font;
#endif
return 0;
}