diff options
author | Cameron Cawley | 2018-12-08 21:10:54 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2018-12-25 12:47:42 +0100 |
commit | 1953aa7064b1d03beb2cc647131cce3948ccf20a (patch) | |
tree | 3e93c4a21add846b20ab769cf76fef86108700f3 /engines/zvision | |
parent | d3bb3cddfdbcda8f2766f4f9e947c1b8c8854b54 (diff) | |
download | scummvm-rg350-1953aa7064b1d03beb2cc647131cce3948ccf20a.tar.gz scummvm-rg350-1953aa7064b1d03beb2cc647131cce3948ccf20a.tar.bz2 scummvm-rg350-1953aa7064b1d03beb2cc647131cce3948ccf20a.zip |
ZVISION: Attempt to load fallback fonts from fonts.dat
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/text/truetype_font.cpp | 9 | ||||
-rw-r--r-- | engines/zvision/zvision.cpp | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/engines/zvision/text/truetype_font.cpp b/engines/zvision/text/truetype_font.cpp index 2bbfe8a706..b99b575eb1 100644 --- a/engines/zvision/text/truetype_font.cpp +++ b/engines/zvision/text/truetype_font.cpp @@ -118,12 +118,15 @@ bool StyledTTFont::loadFont(const Common::String &fontName, int32 point, uint st bool sharp = (_style & TTF_STYLE_SHARP) == TTF_STYLE_SHARP; Common::File file; + Graphics::Font *newFont; if (!file.open(newFontName) && !_engine->getSearchManager()->openFile(file, newFontName) && !file.open(liberationFontName) && !_engine->getSearchManager()->openFile(file, liberationFontName) && - !file.open(freeFontName) && !_engine->getSearchManager()->openFile(file, freeFontName)) - error("Unable to open font file %s (Liberation Font alternative: %s, FreeFont alternative: %s)", newFontName.c_str(), liberationFontName.c_str(), freeFontName.c_str()); + !file.open(freeFontName) && !_engine->getSearchManager()->openFile(file, freeFontName)) { + newFont = Graphics::loadTTFFontFromArchive(freeFontName, point, Graphics::kTTFSizeModeCell, 0, (sharp ? Graphics::kTTFRenderModeMonochrome : Graphics::kTTFRenderModeNormal)); + } else { + newFont = Graphics::loadTTFFont(file, point, Graphics::kTTFSizeModeCell, 0, (sharp ? Graphics::kTTFRenderModeMonochrome : Graphics::kTTFRenderModeNormal)); + } - Graphics::Font *newFont = Graphics::loadTTFFont(file, point, Graphics::kTTFSizeModeCell, 0, (sharp ? Graphics::kTTFRenderModeMonochrome : Graphics::kTTFRenderModeNormal)); if (newFont == nullptr) { return false; } diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 7bd16cb448..41b2297fdb 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -285,7 +285,8 @@ Common::Error ZVision::run() { if (!Common::File::exists(fontName) && !_searchManager->hasFile(fontName) && !Common::File::exists(liberationFontName) && !_searchManager->hasFile(liberationFontName) && - !Common::File::exists(freeFontName) && !_searchManager->hasFile(freeFontName)) { + !Common::File::exists(freeFontName) && !_searchManager->hasFile(freeFontName) && + !Common::File::exists("fonts.dat") && !_searchManager->hasFile("fonts.dat")) { foundAllFonts = false; break; } |