aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorThierry Crozat2010-09-25 22:47:00 +0000
committerThierry Crozat2010-09-25 22:47:00 +0000
commitb1f63deba3afe176646dbf9aae5c22cfab453785 (patch)
treed1de5e4243162f600b0ec456152f640f0704c46a /gui
parent76992402d7d11ced3c0a676774bb768cc4454d10 (diff)
downloadscummvm-rg350-b1f63deba3afe176646dbf9aae5c22cfab453785.tar.gz
scummvm-rg350-b1f63deba3afe176646dbf9aae5c22cfab453785.tar.bz2
scummvm-rg350-b1f63deba3afe176646dbf9aae5c22cfab453785.zip
GUI: Partial fix to bug #3075649 Fonts not found with buit-in theme
When the locale font are not found when loading the theme, it now fallbacks to default language (i.e. English) and default font. For this to work I had to move the TranslationManager initialization before the Theme is loaded. Therefore it is now initialized when the GuiManager is constructed. svn-id: r52896
Diffstat (limited to 'gui')
-rw-r--r--gui/GuiManager.cpp3
-rw-r--r--gui/ThemeEngine.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index bbd7718d71..44c6530d7e 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -62,6 +62,9 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _tooltipCheck(false),
// Clear the cursor
memset(_cursor, 0xFF, sizeof(_cursor));
+
+ // Enable translation
+ TransMan.setLanguage(ConfMan.get("gui_language").c_str());
ConfMan.registerDefault("gui_theme", "scummmodern");
Common::String themefile(ConfMan.get("gui_theme"));
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 0d0fe8aecd..92ecf0346f 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -579,7 +579,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
if (_texts[textId]->_fontPtr)
FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
- // Fallback to non-localized font
+ // Fallback to non-localized font and default translation
else {
// Try built-in fonts
_texts[textId]->_fontPtr = FontMan.getFontByName(file);
@@ -593,7 +593,8 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
FontMan.assignFontToName(file, _texts[textId]->_fontPtr);
}
- warning("Failed to load localized font '%s'. Using non-localized font instead", file.c_str());
+ TransMan.setLanguage("C");
+ warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", file.c_str());
}
}
}