diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index bdc7b3866..6a292a1e8 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -920,7 +920,7 @@ struct ReverseChainSingleSubstFormat1 match_coverage, this, 1)) { - c->buffer->cur().codepoint = substitute[index]; + c->replace_glyph_inplace (substitute[index]); c->buffer->idx--; /* Reverse! */ return TRACE_RETURN (true); } diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 6dc2f162e..e2423bcd0 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -246,6 +246,12 @@ struct hb_apply_context_t set_klass_guess (klass_guess); buffer->replace_glyph (glyph_index); } + inline void replace_glyph_inplace (hb_codepoint_t glyph_index, + unsigned int klass_guess = 0) const + { + set_klass_guess (klass_guess); + buffer->cur().codepoint = glyph_index; + } };