diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-05 21:51:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-05 21:51:03 +0300 |
commit | 5090180c23dd53de111c316286639d3ba8277468 (patch) | |
tree | b936b58ce905a06cc83a5ec70ce08629722abd04 /src/gui/gui.cpp | |
parent | 38489512096ca1f5a79a5fdaf9a73c9f5fda22e2 (diff) | |
download | mv-5090180c23dd53de111c316286639d3ba8277468.tar.gz mv-5090180c23dd53de111c316286639d3ba8277468.tar.bz2 mv-5090180c23dd53de111c316286639d3ba8277468.tar.xz mv-5090180c23dd53de111c316286639d3ba8277468.zip |
Add chinese font auto usage if detected chinese locale.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index db3faa314..3fe0443ca 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -137,6 +137,8 @@ void Gui::postInit(Graphics *const graphics) const StringVect langs = getLang(); const bool isJapan = (!langs.empty() && langs[0].size() > 3 && langs[0].substr(0, 3) == "ja_"); + const bool isChinese = (!langs.empty() && langs[0].size() > 3 + && langs[0].substr(0, 3) == "zh_"); // Set global font const int fontSize = config.getIntValue("fontSize"); @@ -147,6 +149,12 @@ void Gui::postInit(Graphics *const graphics) if (fontFile.empty()) fontFile = branding.getStringValue("japanFont"); } + else if(isChinese) + { + fontFile = config.getValue("chinaFont", ""); + if (fontFile.empty()) + fontFile = branding.getStringValue("chinaFont"); + } if (fontFile.empty()) fontFile = branding.getStringValue("font"); @@ -170,6 +178,12 @@ void Gui::postInit(Graphics *const graphics) if (fontFile.empty()) fontFile = branding.getStringValue("japanFont"); } + else if(isChinese) + { + fontFile = config.getValue("chinaFont", ""); + if (fontFile.empty()) + fontFile = branding.getStringValue("chinaFont"); + } if (fontFile.empty()) |