Issue #1862 - Follow-up: Replace deprecated Harfbuzz functions with current ones.

Based on Mozilla bug 1500356.
This commit is contained in:
Job Bautista 2023-04-30 21:20:06 +08:00 committed by roytam1
commit 51426d1053
7 changed files with 73 additions and 78 deletions

View file

@ -1171,12 +1171,14 @@ gfxFont::CheckForFeaturesInvolvingSpace()
sScriptTagToCode->Put(HB_TAG('D','F','L','T'), Script::COMMON);
for (Script s = Script::ARABIC; s < Script::NUM_SCRIPT_CODES;
s = Script(static_cast<int>(s) + 1)) {
hb_script_t scriptTag = hb_script_t(GetScriptTagForCode(s));
hb_tag_t s1, s2;
hb_ot_tags_from_script(scriptTag, &s1, &s2);
sScriptTagToCode->Put(s1, s);
if (s2 != HB_OT_TAG_DEFAULT_SCRIPT) {
sScriptTagToCode->Put(s2, s);
hb_script_t script = hb_script_t(GetScriptTagForCode(s));
unsigned int scriptCount = 4;
hb_tag_t scriptTags[4];
hb_ot_tags_from_script_and_language(script, HB_LANGUAGE_INVALID,
&scriptCount, scriptTags, nullptr,
nullptr);
for (unsigned int i = 0; i < scriptCount; i++) {
sScriptTagToCode->Put(scriptTags[i], s);
}
}