Prefer GPOS over kerx, if GSUB was applied

Fixes https://github.com/harfbuzz/harfbuzz/issues/3008
This commit is contained in:
Behdad Esfahbod 2021-06-13 05:28:20 -06:00
parent 13c6ad980f
commit 5bc05ba155
2 changed files with 7 additions and 2 deletions

View File

@ -149,13 +149,15 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
* Decide who does positioning. GPOS, kerx, kern, or fallback.
*/
bool has_gsub = hb_ot_layout_has_substitution (face);
bool has_gpos = !disable_gpos && hb_ot_layout_has_positioning (face);
if (0)
;
#ifndef HB_NO_AAT_SHAPE
else if (hb_aat_layout_has_positioning (face))
else if (hb_aat_layout_has_positioning (face) && !(has_gsub && has_gpos))
plan.apply_kerx = true;
#endif
else if (!apply_morx && !disable_gpos && hb_ot_layout_has_positioning (face))
else if (!apply_morx && has_gpos)
plan.apply_gpos = true;
if (!plan.apply_kerx && (!has_gpos_kern || !plan.apply_gpos))

View File

@ -1,3 +1,6 @@
# https://github.com/harfbuzz/harfbuzz/issues/3008
/System/Library/Fonts/ヒラギノ丸ゴ\ ProN\ W4.ttc:--features=palt:U+FF11:[gid781=0@-78,0+842]
# https://github.com/harfbuzz/harfbuzz/pull/2871
/System/Library/Fonts/LucidaGrande.ttc:--font-funcs ot --show-flags:U+0041,U+0042,U+0043,U+0044:[A=0+1413|B=1+1178|C=2+1417|D=3+1534]