From f9d86e2d73bb57239ad37da1bd5e7bc9f1bf7720 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 26 May 2026 18:47:19 +0200 Subject: [PATCH] [aat] Mark in-place deleted glyph replacements Contextual and non-contextual AAT subtables replace glyphs in place. When such a replacement produced the AAT deleted glyph, we changed only the glyph ID and did not set the AAT-deleted metadata that later cleanup uses to remove deleted glyphs from the buffer. Make replace_glyph_inplace() match the other AAT replacement helpers by setting the deleted scratch flag and glyph-info marker for glyph 0xFFFF. Testing: - b/util/hb-shape CharcoalCY.dfont --unicodes=002D,002D - b/util/hb-shape CharcoalCY.dfont Empty-handed - meson test -Cb Assisted-by: OpenAI Codex --- src/hb-aat-layout-common.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index e4040446e..9e788e5f7 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -228,6 +228,11 @@ struct hb_aat_apply_context_t : void replace_glyph_inplace (unsigned i, hb_codepoint_t glyph) { buffer->info[i].codepoint = glyph; + if (glyph == DELETED_GLYPH) + { + buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_AAT_HAS_DELETED; + _hb_glyph_info_set_aat_deleted (&buffer->info[i]); + } if (likely (using_buffer_glyph_set)) buffer_glyph_set->add (glyph); #ifndef HB_NO_OT_LAYOUT