[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
This commit is contained in:
Behdad Esfahbod committed 2026-05-26 18:47:19 +02:00
1 parent 20bc59869e
commit f9d86e2d73
1 file changed
+5
+5
View File
@@ -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