From 5c272e3613667ca532f32764824784c63d797f57 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 25 Oct 2018 17:36:33 -0700 Subject: [PATCH] [morx] Remove deleted-glyph at the end of processing --- src/hb-aat-layout-morx-table.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index c663fcc84..a3077e574 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -998,6 +998,22 @@ struct morx } } + inline static void remove_deleted_glyphs (hb_buffer_t *buffer) + { + if (unlikely (!buffer->successful)) return; + + buffer->clear_output (); + for (buffer->idx = 0; buffer->idx < buffer->len && buffer->successful;) + { + if (unlikely (buffer->cur().codepoint == DELETED_GLYPH)) + buffer->skip_glyph (); + else + buffer->next_glyph (); + } + if (likely (buffer->successful)) + buffer->swap_buffers (); + } + inline void apply (hb_aat_apply_context_t *c) const { if (unlikely (!c->buffer->successful)) return; @@ -1010,6 +1026,7 @@ struct morx if (unlikely (!c->buffer->successful)) return; chain = &StructAfter (*chain); } + remove_deleted_glyphs (c->buffer); } inline bool sanitize (hb_sanitize_context_t *c) const