diff options
author | Cameron Cawley | 2018-12-08 21:11:36 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2018-12-25 12:47:42 +0100 |
commit | 364f78e99fcd7cabb71c5d9d7f431730297c8616 (patch) | |
tree | ce964e314646856773acce5fd5eab68c6fb4ba74 /gui/ThemeEngine.cpp | |
parent | 1953aa7064b1d03beb2cc647131cce3948ccf20a (diff) | |
download | scummvm-rg350-364f78e99fcd7cabb71c5d9d7f431730297c8616.tar.gz scummvm-rg350-364f78e99fcd7cabb71c5d9d7f431730297c8616.tar.bz2 scummvm-rg350-364f78e99fcd7cabb71c5d9d7f431730297c8616.zip |
GUI: Attempt to load fonts from fonts.dat if they aren't present in the theme archive
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r-- | gui/ThemeEngine.cpp | 18 |
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; } |