aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.cpp
diff options
context:
space:
mode:
authorThierry Crozat2011-05-22 15:43:35 +0100
committerThierry Crozat2011-06-06 23:20:09 +0100
commit6b13782967b8b775c359b0ff54e7a17534248dbe (patch)
treed290ff1a2523c5d26ae4ad96942d32ac50808c3c /gui/ThemeEngine.cpp
parent592cca5402f9162fc70b48f40b95faec44341bd0 (diff)
downloadscummvm-rg350-6b13782967b8b775c359b0ff54e7a17534248dbe.tar.gz
scummvm-rg350-6b13782967b8b775c359b0ff54e7a17534248dbe.tar.bz2
scummvm-rg350-6b13782967b8b775c359b0ff54e7a17534248dbe.zip
GRAPHICS: Move genLocalizedFontFilename() to FontManager class
It was defined in ThemeEngine class , but I moved it to make it possible to use localized font in other places.
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r--gui/ThemeEngine.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index f8e94ade97..73c1835c9e 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -561,7 +561,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) {
if (file == "default") {
_texts[textId]->_fontPtr = _font;
} else {
- Common::String localized = genLocalizedFontFilename(file);
+ Common::String localized = FontMan.genLocalizedFontFilename(file);
// Try built-in fonts
_texts[textId]->_fontPtr = FontMan.getFontByName(localized);
@@ -1468,32 +1468,6 @@ Common::String ThemeEngine::genCacheFilename(const Common::String &filename) con
return Common::String();
}
-Common::String ThemeEngine::genLocalizedFontFilename(const Common::String &filename) const {
-#ifndef USE_TRANSLATION
- return filename;
-#else
- // We will transform the font filename in the following way:
- // name.bdf
- // will become:
- // name-charset.bdf
- // Note that name should not contain any dot here!
-
- // In the first step we look for the dot. In case there is none we will
- // return the normal filename.
- Common::String::const_iterator dot = Common::find(filename.begin(), filename.end(), '.');
- if (dot == filename.end())
- return filename;
-
- // Put the translated font filename string back together.
- Common::String result(filename.begin(), dot);
- result += '-';
- result += TransMan.getCurrentCharset();
- result += dot;
-
- return result;
-#endif
-}
-
/**********************************************************
* Static Theme XML functions