From 9c0c31dfaab3dd3b3debb2604fec580ca6fdfb62 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 31 May 2022 09:35:49 -0600 Subject: [PATCH] [buffer] When deleting glyphs, check cluster backwards as well --- src/hb-buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 1baa9af5c..bd786f9f4 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -543,7 +543,8 @@ hb_buffer_t::delete_glyph () /* The logic here is duplicated in hb_ot_hide_default_ignorables(). */ unsigned int cluster = info[idx].cluster; - if (idx + 1 < len && cluster == info[idx + 1].cluster) + if ((idx + 1 < len && cluster == info[idx + 1].cluster) || + (out_len && cluster == out_info[out_len - 1].cluster)) { /* Cluster survives; do nothing. */ goto done;