From 9b0b40b3c1ac8155c80ed5dc976228f4d3ec7e1f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 28 Sep 2018 11:16:18 -0400 Subject: [PATCH] Fix fallback kerning to check for current glyph's mask --- src/hb-ot-shape-fallback.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index 5f43023be..5fec9d87d 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -444,7 +444,8 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan, if (!plan->has_kern) return; OT::hb_ot_apply_context_t c (1, font, buffer); - c.set_lookup_mask (plan->kern_mask); + hb_mask_t kern_mask = plan->kern_mask; + c.set_lookup_mask (kern_mask); c.set_lookup_props (OT::LookupFlag::IgnoreMarks); OT::hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c.iter_input; skippy_iter.init (&c); @@ -454,6 +455,12 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan, hb_glyph_position_t *pos = buffer->pos; for (unsigned int idx = 0; idx < count;) { + if (!(buffer->cur().mask & kern_mask)) + { + idx++; + continue; + } + skippy_iter.reset (idx, 1); if (!skippy_iter.next ()) {