aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-17 23:51:58 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commitce64528129d4a1ba51e339bd8be3548c4d8cc3bf (patch)
treea16ca7f095685ea95ea4ffa5c845db0f45ce9e46 /gui
parent33f8aadfeb81ead60ce1264f0af681dcdbd4931f (diff)
downloadscummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.tar.gz
scummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.tar.bz2
scummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.zip
TTS: Make sure that TTS lang matches transMan lang
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp14
-rw-r--r--gui/gui-manager.cpp1
2 files changed, 12 insertions, 3 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 598d9c2ab8..dd074ccef3 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -530,7 +530,12 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file, const Com
error("Couldn't load font '%s'/'%s'", file.c_str(), scalableFile.c_str());
#ifdef USE_TRANSLATION
TransMan.setLanguage("C");
-#endif
+#ifdef USE_TTS
+ Common::TextToSpeechManager *ttsMan;
+ if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr)
+ ttsMan->setLanguage("en");
+#endif // USE_TTS
+#endif // USE_TRANSLATION
return false; // fall-back attempt failed
}
// Success in fall-back attempt to standard (non-localized) font.
@@ -538,7 +543,12 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file, const Com
// FIXME If we return false anyway why would we attempt the fall-back in the first place?
#ifdef USE_TRANSLATION
TransMan.setLanguage("C");
-#endif
+#ifdef USE_TTS
+ Common::TextToSpeechManager *ttsMan;
+ if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr)
+ ttsMan->setLanguage("en");
+#endif // USE_TTS
+#endif // USE_TRANSLATION
// Returning true here, would allow falling back to standard fonts for the missing ones,
// but that leads to "garbage" glyphs being displayed on screen for non-Latin languages
return false;
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index c77af7c71f..b149908ffe 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -632,7 +632,6 @@ void GuiManager::initTextToSpeech() {
Common::String currentLanguage = TransMan.getCurrentLanguage();
if (currentLanguage != "C") {
currentLanguage.setChar('\0', 2);
- debug("%s", TransMan.getCurrentCharset().c_str());
ttsMan->setLanguage(currentLanguage);
}
#endif