[aat] Apply kerx if GPOS kern was not applied

Ned tells me this is what Apple does.
This commit is contained in:
Behdad Esfahbod 2018-10-11 13:26:58 -04:00
parent b59a428af0
commit 0b9d60e1a1
1 changed files with 8 additions and 10 deletions

View File

@ -100,18 +100,16 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
else if (hb_aat_layout_has_positioning (face)) else if (hb_aat_layout_has_positioning (face))
plan.apply_kerx = true; plan.apply_kerx = true;
if (plan.requested_kerning) if (plan.requested_kerning && !plan.apply_kerx && !has_gpos_kern)
{
if (plan.apply_kerx)
;/* kerx supercedes kern. */
else if (!has_gpos_kern)
{ {
/* Apparently Apple applies kerx if GPOS kern was not applied. */
if (hb_aat_layout_has_positioning (face))
plan.apply_kerx = true;
if (hb_ot_layout_has_kerning (face)) if (hb_ot_layout_has_kerning (face))
plan.apply_kern = true; plan.apply_kern = true;
else else
plan.fallback_kerning = true; plan.fallback_kerning = true;
} }
}
plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k')); plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
if (!plan.apply_gpos && !plan.apply_kerx) if (!plan.apply_gpos && !plan.apply_kerx)