[Indic] Reorder Reph to before the Halant after Matras

Uniscribe doesn't do it, but we want to do as it gives the Reph the
opportunity to interact with the Matras.  Test with mangal for example.
Sequence: <0930,094d,0915,094b,094d>
In test suite already.
This commit is contained in:
Behdad Esfahbod 2012-05-10 15:41:04 +02:00
parent daf3234bdc
commit 8df5636968
1 changed files with 12 additions and 0 deletions

View File

@ -582,6 +582,18 @@ final_reordering_syllable (hb_buffer_t *buffer,
while (new_reph_pos > start && (FLAG (info[new_reph_pos].indic_position()) & (FLAG (POS_SMVD))))
new_reph_pos--;
if (unlikely (info[new_reph_pos].indic_category() == OT_H)) {
/* *If* the Reph is to be ending up after a Matra,Halant sequence,
* position it before that Halant so it can interact with the Matra.
* However, if it's a plain Consonant,Halant we shouldn't do that.
*/
for (unsigned int i = base + 1; i < new_reph_pos; i++)
if (info[i].indic_category() == OT_M) {
/* Ok, got it. */
new_reph_pos--;
}
}
/* Move */
hb_glyph_info_t reph = info[start];
memmove (&info[start], &info[start + 1], (new_reph_pos - start) * sizeof (info[0]));