diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2018-11-20 18:08:24 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2018-11-20 19:20:50 +0100 |
commit | 476525277727fe1550ff77f0d9979604ac74d00f (patch) | |
tree | 822a4ef9694a2d9415100debaf1c610cd7828be0 /vcl | |
parent | 542d17d9384cced62db6bcfa45a5f44316409edc (diff) |
Don’t split HarfBuzz runs for Japanese text
Change-Id: Ib1b632690ae8491732d893788c9b09ced8e49933
Reviewed-on: https://gerrit.libreoffice.org/63668
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/scrptrun.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/gdi/scrptrun.cxx b/vcl/source/gdi/scrptrun.cxx index cbf16d6e85bd..f19e169fe93e 100644 --- a/vcl/source/gdi/scrptrun.cxx +++ b/vcl/source/gdi/scrptrun.cxx @@ -115,6 +115,19 @@ struct PairIndices }; +// There are three Unicode script codes for Japaneese text, but only one +// OpenType script tag, so we want to keep them in one run as splitting is +// pointless for the purpose of OpenType shaping. +UScriptCode getScript(UChar32 ch, UErrorCode* status) +{ + UScriptCode script = uscript_getScript(ch, status); + if (U_FAILURE(*status)) + return script; + if (script == USCRIPT_KATAKANA || script == USCRIPT_KATAKANA_OR_HIRAGANA) + return USCRIPT_HIRAGANA; + return script; +} + } static const PairIndices gPairIndices; @@ -159,7 +172,7 @@ UBool ScriptRun::next() } } - UScriptCode sc = uscript_getScript(ch, &error); + UScriptCode sc = getScript(ch, &error); int32_t pairIndex = gPairIndices.getPairIndex(ch); // Paired character handling: |