vcl/source/gdi/scrptrun.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
New commits: commit 476525277727fe1550ff77f0d9979604ac74d00f Author: Khaled Hosny <khaledho...@eglug.org> AuthorDate: Tue Nov 20 18:08:24 2018 +0200 Commit: Khaled Hosny <khaledho...@eglug.org> CommitDate: Tue Nov 20 19:20:50 2018 +0100 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 <khaledho...@eglug.org> 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: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits