[Indic] Update clusters for left-matra even if matra didn't move

Fixes crashes reported with left matra under
non-uniscribe-bug-compatibilty mode.
This commit is contained in:
Behdad Esfahbod 2012-07-22 23:55:19 -04:00
parent 60554f14d8
commit abb3239ef9
1 changed files with 8 additions and 1 deletions

View File

@ -859,7 +859,8 @@ final_reordering_syllable (hb_buffer_t *buffer,
while (new_pos > start &&
!(FLAG (info[new_pos].indic_category()) & (FLAG (OT_M) | FLAG (OT_H) | FLAG (OT_Coeng))))
new_pos--;
/* If we found no Halant we are done. Otherwise only proceed if the Halant does
/* If we found no Halant we are done (just need to update clusters).
* Otherwise only proceed if the Halant does
* not belong to the Matra itself! */
if (is_halant_or_coeng (info[new_pos]) &&
info[new_pos].indic_position() != POS_PRE_M) {
@ -878,6 +879,12 @@ final_reordering_syllable (hb_buffer_t *buffer,
start_of_last_cluster = MIN (new_pos, start_of_last_cluster);
new_pos--;
}
} else {
for (unsigned int i = start; i < start_of_last_cluster; i++)
if (info[i].indic_position () == POS_PRE_M) {
start_of_last_cluster = i;
break;
}
}
}