Kaydet (Commit) 47652527 authored tarafından Khaled Hosny's avatar Khaled Hosny

Don’t split HarfBuzz runs for Japanese text

Change-Id: Ib1b632690ae8491732d893788c9b09ced8e49933
Reviewed-on: https://gerrit.libreoffice.org/63668
Tested-by: Jenkins
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 542d17d9
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment