diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 49986ea77..c9e10bdc4 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -955,7 +955,12 @@ struct MarkBasePosFormat1 /* now we search backwards for a non-mark glyph */ unsigned int property; hb_apply_context_t::mark_skipping_backward_iterator_t skippy_iter (c, c->buffer->idx, 1); - if (!skippy_iter.prev (&property, LookupFlag::IgnoreMarks)) return TRACE_RETURN (false); + do { + if (!skippy_iter.prev (&property, LookupFlag::IgnoreMarks)) return TRACE_RETURN (false); + /* We only want to attach to the first of a MultipleSubst sequence. Reject others. */ + if (0 == get_lig_comp (c->buffer->info[skippy_iter.idx])) break; + skippy_iter.reject (); + } while (1); /* The following assertion is too strong, so we've disabled it. */ if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)) {/*return TRACE_RETURN (false);*/} diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index d73bb29bf..4cf615090 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -144,6 +144,10 @@ struct hb_apply_context_t { return unlikely (num_items && idx + num_items >= end); } + inline bool reject (void) + { + num_items++; + } inline bool next (unsigned int *property_out, unsigned int lookup_props) { @@ -189,6 +193,10 @@ struct hb_apply_context_t { return unlikely (idx < num_items); } + inline bool reject (void) + { + num_items++; + } inline bool prev (unsigned int *property_out, unsigned int lookup_props) {