aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/font
diff options
context:
space:
mode:
authorCameron Cawley2018-12-08 21:10:24 +0000
committerEugene Sandulenko2018-12-25 12:47:42 +0100
commitd3bb3cddfdbcda8f2766f4f9e947c1b8c8854b54 (patch)
treec4480d18320ecb3748a4fa55d4521f0b2da68821 /engines/wintermute/base/font
parentfa60ae728e2b54eceaefd57b82752056cfa198bb (diff)
downloadscummvm-rg350-d3bb3cddfdbcda8f2766f4f9e947c1b8c8854b54.tar.gz
scummvm-rg350-d3bb3cddfdbcda8f2766f4f9e947c1b8c8854b54.tar.bz2
scummvm-rg350-d3bb3cddfdbcda8f2766f4f9e947c1b8c8854b54.zip
WINTERMUTE: Attempt to load fallback fonts from fonts.dat
Diffstat (limited to 'engines/wintermute/base/font')
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index fa6973c58f..93084ca8a1 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -38,7 +38,6 @@
#include "graphics/fonts/ttf.h"
#include "graphics/fontman.h"
#include "common/unzip.h"
-#include "common/config-manager.h" // For Scummmodern.zip
#include <limits.h>
namespace Wintermute {
@@ -587,35 +586,10 @@ bool BaseFontTT::initFont() {
file = nullptr;
}
- // Fallback2: Try to find ScummModern.zip, and get the font from there:
+ // Fallback2: Try load the font from the common fonts archive:
if (!_font) {
- Common::SeekableReadStream *themeFile = nullptr;
- if (ConfMan.hasKey("themepath")) {
- Common::FSNode themePath(ConfMan.get("themepath"));
- if (themePath.exists()) {
- Common::FSNode scummModern = themePath.getChild("scummmodern.zip");
- if (scummModern.exists()) {
- themeFile = scummModern.createReadStream();
- }
- }
- }
- if (!themeFile) { // Fallback 2.5: Search for ScummModern.zip in SearchMan.
- themeFile = SearchMan.createReadStreamForMember("scummmodern.zip");
- }
- if (themeFile) {
- Common::Archive *themeArchive = Common::makeZipArchive(themeFile);
- if (themeArchive->hasFile(fallbackFilename)) {
- file = nullptr;
- file = themeArchive->createReadStreamForMember(fallbackFilename);
- _deletableFont = Graphics::loadTTFFont(*file, _fontHeight, Graphics::kTTFSizeModeCharacter, 96); // Use the same dpi as WME (96 vs 72).
- _font = _deletableFont;
- }
- // We're not using BaseFileManager, so clean up after ourselves:
- delete file;
- file = nullptr;
- delete themeArchive;
- themeArchive = nullptr;
- }
+ _deletableFont = Graphics::loadTTFFontFromArchive(fallbackFilename, _fontHeight, Graphics::kTTFSizeModeCharacter, 96); // Use the same dpi as WME (96 vs 72).
+ _font = _deletableFont;
}
// Fallback3: Try to ask FontMan for the FreeSans.ttf ScummModern.zip uses: