From 5090180c23dd53de111c316286639d3ba8277468 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Jan 2014 21:51:03 +0300 Subject: Add chinese font auto usage if detected chinese locale. --- src/gui/gui.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gui/gui.cpp') 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()) -- cgit v1.2.3-70-g09d2