From e51d2b6ed1c794ac28c5610bfd01dbc9fb383633 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 8 Jun 2012 20:33:27 -0400 Subject: [PATCH] Extend into main buffer if extension hit end of out-buffer merging clusters --- src/hb-buffer.cc | 5 +++++ src/hb-ot-shape-complex-misc.cc | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 2a9849756..8ccfea5f3 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -468,6 +468,11 @@ hb_buffer_t::merge_out_clusters (unsigned int start, while (end < out_len && out_info[end - 1].cluster == out_info[end].cluster) end++; + /* If we hit the end of out-buffer, continue in buffer. */ + if (end == out_len) + for (unsigned i = idx; i < len && info[i].cluster == out_info[end - 1].cluster; i++) + info[i].cluster = cluster; + for (unsigned int i = start; i < end; i++) out_info[i].cluster = cluster; } diff --git a/src/hb-ot-shape-complex-misc.cc b/src/hb-ot-shape-complex-misc.cc index 748d4b331..52fbd6d31 100644 --- a/src/hb-ot-shape-complex-misc.cc +++ b/src/hb-ot-shape-complex-misc.cc @@ -176,15 +176,6 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map HB_UNUSED, sizeof (buffer->out_info[0]) * (end - start - 2)); buffer->out_info[start] = t; - /* XXX Make this easier! */ - /* Make cluster */ - for (; buffer->idx < count;) - if (buffer->cur().cluster == buffer->prev().cluster) - buffer->next_glyph (); - else - break; - end = buffer->out_len; - buffer->merge_out_clusters (start, end); } buffer->swap_buffers ();