From 8df5636968389ac7bf8620ccd091fd4872b0bbee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 10 May 2012 15:41:04 +0200 Subject: [PATCH] [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. --- src/hb-ot-shape-complex-indic.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 575880b42..b0e8ade07 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -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]));