Extend clusters backward in out-buffer

This commit is contained in:
Behdad Esfahbod 2012-06-08 20:30:03 -04:00
parent cd5891493d
commit 72c0a18783
2 changed files with 8 additions and 2 deletions

View File

@ -452,10 +452,18 @@ void
hb_buffer_t::merge_out_clusters (unsigned int start,
unsigned int end)
{
if (unlikely (start >= end))
return;
unsigned int cluster = out_info[start].cluster;
for (unsigned int i = start + 1; i < end; i++)
cluster = MIN (cluster, out_info[i].cluster);
/* Extend start */
while (start && out_info[start - 1].cluster == out_info[start].cluster)
start--;
for (unsigned int i = start; i < end; i++)
out_info[i].cluster = cluster;
}

View File

@ -178,8 +178,6 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map HB_UNUSED,
/* XXX Make this easier! */
/* Make cluster */
for (; start > 0 && buffer->out_info[start - 1].cluster == buffer->out_info[start].cluster; start--)
;
for (; buffer->idx < count;)
if (buffer->cur().cluster == buffer->prev().cluster)
buffer->next_glyph ();