Extend into main buffer if extension hit end of out-buffer merging clusters

This commit is contained in:
Behdad Esfahbod 2012-06-08 20:33:27 -04:00
parent 5ced012d9f
commit e51d2b6ed1
2 changed files with 5 additions and 9 deletions

View File

@ -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;
}

View File

@ -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 ();