From ce64528129d4a1ba51e339bd8be3548c4d8cc3bf Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 17 Jul 2019 23:51:58 +0200 Subject: TTS: Make sure that TTS lang matches transMan lang --- gui/ThemeEngine.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gui/ThemeEngine.cpp') 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; -- cgit v1.2.3