[morx] Fix merge_cluster to end at last ligature component

Don't assume current position was a component in the ligature.
This commit is contained in:
Behdad Esfahbod 2018-10-26 22:02:17 -07:00
parent 00ae4be6bf
commit 6aa019c4af
1 changed files with 2 additions and 1 deletions

View File

@ -443,6 +443,7 @@ struct LigatureSubtable
DEBUG_MSG (APPLY, nullptr, "Produced ligature %d", lig); DEBUG_MSG (APPLY, nullptr, "Produced ligature %d", lig);
buffer->replace_glyph (lig); buffer->replace_glyph (lig);
unsigned int lig_end = match_positions[match_length - 1] + 1;
/* Now go and delete all subsequent components. */ /* Now go and delete all subsequent components. */
while (match_length - 1 > cursor) while (match_length - 1 > cursor)
{ {
@ -451,7 +452,7 @@ struct LigatureSubtable
buffer->replace_glyph (DELETED_GLYPH); buffer->replace_glyph (DELETED_GLYPH);
} }
buffer->move_to (end + 1); buffer->move_to (lig_end);
buffer->merge_out_clusters (match_positions[cursor], buffer->out_len); buffer->merge_out_clusters (match_positions[cursor], buffer->out_len);
} }