summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-11-18 00:45:13 +0800
committerCaolán McNamara <caolanm@redhat.com>2015-11-26 12:11:17 +0000
commit48cf2d9fe9eea5e6fae310058b6f705553996635 (patch)
tree41f12d41be4498efe9e562cf5287d3983b235785 /vcl
parent0b5e3885bc706ed02acac1c682c90171700b0cac (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
Diffstat (limited to 'vcl')
-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();