[buffer] When deleting glyphs, check cluster backwards as well

pull/3621/head
Behdad Esfahbod 2 years ago
parent 0384f80e78
commit 9c0c31dfaa
  1. 3
      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;

Loading…
Cancel
Save