Extend clusters backward in out-buffer
This commit is contained in:
parent
cd5891493d
commit
72c0a18783
|
@ -452,10 +452,18 @@ void
|
||||||
hb_buffer_t::merge_out_clusters (unsigned int start,
|
hb_buffer_t::merge_out_clusters (unsigned int start,
|
||||||
unsigned int end)
|
unsigned int end)
|
||||||
{
|
{
|
||||||
|
if (unlikely (start >= end))
|
||||||
|
return;
|
||||||
|
|
||||||
unsigned int cluster = out_info[start].cluster;
|
unsigned int cluster = out_info[start].cluster;
|
||||||
|
|
||||||
for (unsigned int i = start + 1; i < end; i++)
|
for (unsigned int i = start + 1; i < end; i++)
|
||||||
cluster = MIN (cluster, out_info[i].cluster);
|
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++)
|
for (unsigned int i = start; i < end; i++)
|
||||||
out_info[i].cluster = cluster;
|
out_info[i].cluster = cluster;
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,8 +178,6 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map HB_UNUSED,
|
||||||
|
|
||||||
/* XXX Make this easier! */
|
/* XXX Make this easier! */
|
||||||
/* Make cluster */
|
/* Make cluster */
|
||||||
for (; start > 0 && buffer->out_info[start - 1].cluster == buffer->out_info[start].cluster; start--)
|
|
||||||
;
|
|
||||||
for (; buffer->idx < count;)
|
for (; buffer->idx < count;)
|
||||||
if (buffer->cur().cluster == buffer->prev().cluster)
|
if (buffer->cur().cluster == buffer->prev().cluster)
|
||||||
buffer->next_glyph ();
|
buffer->next_glyph ();
|
||||||
|
|
Loading…
Reference in New Issue