From 6aa019c4af6b64bb732205e6051f3e73e1b70721 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 26 Oct 2018 22:02:17 -0700 Subject: [PATCH] [morx] Fix merge_cluster to end at last ligature component Don't assume current position was a component in the ligature. --- src/hb-aat-layout-morx-table.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index 5b21358ec..a56209104 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -443,6 +443,7 @@ struct LigatureSubtable DEBUG_MSG (APPLY, nullptr, "Produced ligature %d", lig); buffer->replace_glyph (lig); + unsigned int lig_end = match_positions[match_length - 1] + 1; /* Now go and delete all subsequent components. */ while (match_length - 1 > cursor) { @@ -451,7 +452,7 @@ struct LigatureSubtable buffer->replace_glyph (DELETED_GLYPH); } - buffer->move_to (end + 1); + buffer->move_to (lig_end); buffer->merge_out_clusters (match_positions[cursor], buffer->out_len); }