aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/text/truetype_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision/text/truetype_font.cpp')
-rw-r--r--engines/zvision/text/truetype_font.cpp9
1 files changed, 6 insertions, 3 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;
}