From 94f5c630fc07e6aa653ac552b90444f9e7ea7c7f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Mar 2022 11:25:44 -0600 Subject: [PATCH] [aat] Remove morx deleted-glyphs before GPOS processing Fixes new Apple Color Emoji glyphs sequences rendering. Fixes https://github.com/harfbuzz/harfbuzz/issues/3512 --- src/hb-ot-shape.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 4bd8aaf03..298cf4778 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -935,17 +935,23 @@ hb_ot_substitute_pre (const hb_ot_shape_context_t *c) _hb_buffer_allocate_gsubgpos_vars (c->buffer); hb_ot_substitute_complex (c); + +#ifndef HB_NO_AAT_SHAPE + if (c->plan->apply_morx && c->plan->apply_gpos) + hb_aat_layout_remove_deleted_glyphs (c->buffer); +#endif } static inline void hb_ot_substitute_post (const hb_ot_shape_context_t *c) { - hb_ot_hide_default_ignorables (c->buffer, c->font); #ifndef HB_NO_AAT_SHAPE - if (c->plan->apply_morx) + if (c->plan->apply_morx && !c->plan->apply_gpos) hb_aat_layout_remove_deleted_glyphs (c->buffer); #endif + hb_ot_hide_default_ignorables (c->buffer, c->font); + if (c->plan->shaper->postprocess_glyphs && c->buffer->message(c->font, "start postprocess-glyphs")) { c->plan->shaper->postprocess_glyphs (c->plan, c->buffer, c->font);