From 9b5af3ec7f80a7793d5d3891e762d83026de0a5b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 10 Feb 2018 21:50:26 -0600 Subject: [PATCH] [gpos] Adjust mark attachment heuristic Hopefully it... fixes https://github.com/harfbuzz/harfbuzz/issues/740 --- src/hb-ot-layout-gpos-table.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 3ef3d30b0..14ee37131 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1072,9 +1072,14 @@ struct MarkBasePosFormat1 skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); do { if (!skippy_iter.prev ()) return_trace (false); - /* We only want to attach to the first of a MultipleSubst sequence. Reject others. */ + /* We only want to attach to the first of a MultipleSubst sequence. + * https://github.com/harfbuzz/harfbuzz/issues/740 + * Reject others. */ if (!_hb_glyph_info_multiplied (&buffer->info[skippy_iter.idx]) || - 0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx])) + 0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) || + (skippy_iter.idx == 0 || + _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]) != + _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx - 1]))) break; skippy_iter.reject (); } while (1);