summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-11-18 00:45:13 +0800
committerAndras Timar <andras.timar@collabora.com>2015-11-28 14:15:49 +0100
commit1f018f55b197a873b86cf3403e39467303571d9f (patch)
tree29571c2a07b2e250b52f0ec25bf3f7e13d3ea386 /vcl/generic
parent61a1beb07b6be87c77004ebb6ecd34fe5f211cba (diff)
tdf#91288 Does not display traditional Chinese variant of
Noto fonts correctly. LanguageTag()::getLanguage() would always return "zh" despite traditional Chinese were choose. hb_language_from_string() requires iso639-3 language tag except for Chinese, so we use use Bcp47() language tag for Chinese to differ zh-CN and the others. Change-Id: I6700a79a9c49a97d840b430def77741912935f72 Reviewed-on: https://gerrit.libreoffice.org/20027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 4424daa225e73d291a3fd64d369cdda5857f3d51) Reviewed-on: https://gerrit.libreoffice.org/20204 (cherry picked from commit 48cf2d9fe9eea5e6fae310058b6f705553996635)
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 6b3f0ae22d02..4ada68344174 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -461,8 +461,10 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
int nEndRunPos = it->mnEnd;
int nRunLen = nEndRunPos - nMinRunPos;
maHbScript = it->maScript;
+ // hb_language_from_string() accept ISO639-3 language tag except for Chinese.
+ LanguageTag &rTag = rArgs.maLanguageTag;
+ OString sLanguage = OUStringToOString( MsLangId::isChinese(rTag.getLanguageType()) ? rTag.getBcp47():rTag.getLanguage() , RTL_TEXTENCODING_UTF8 );
- OString sLanguage = OUStringToOString(rArgs.maLanguageTag.getLanguage(), RTL_TEXTENCODING_UTF8);
static hb_unicode_funcs_t* pHbUnicodeFuncs = getUnicodeFuncs();