From 0b9d60e1a1c4b7867ac907bbd7c004191a14e697 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Oct 2018 13:26:58 -0400 Subject: [PATCH] [aat] Apply kerx if GPOS kern was not applied Ned tells me this is what Apple does. --- src/hb-ot-shape.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 2b147e3..a553887 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -100,17 +100,15 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, else if (hb_aat_layout_has_positioning (face)) 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) - { - if (hb_ot_layout_has_kerning (face)) - plan.apply_kern = true; - else - plan.fallback_kerning = true; - } + /* 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)) + plan.apply_kern = true; + else + plan.fallback_kerning = true; } plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k')); -- 2.7.4