diff options
author | Mark Hung <marklh9@gmail.com> | 2015-11-18 00:45:13 +0800 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-26 12:10:58 +0000 |
commit | ff592b85f02a1e16aa1668c874e733331e4e242b (patch) | |
tree | f72de5faae738aaf8d5303a0099cb3c525421c4e | |
parent | fa18c83e4e2bddf8f25e4dc3b93ba667ec2a8c11 (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/20203
-rw-r--r-- | vcl/generic/glyphs/gcach_layout.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index 38ea6accb218..127dd06d90bf 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -466,8 +466,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(); |