From 1953aa7064b1d03beb2cc647131cce3948ccf20a Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sat, 8 Dec 2018 21:10:54 +0000 Subject: ZVISION: Attempt to load fallback fonts from fonts.dat --- engines/zvision/text/truetype_font.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/zvision/text') 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; } -- cgit v1.2.3