From cfd4382ec1af91640129551697de36fd42c0849a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 31 Jul 2011 15:07:11 -0400 Subject: [PATCH] [Indic] Handle Reph when determining base consonant --- src/hb-ot-shape-complex-indic.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 82c247a..cfc1c4b 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -443,6 +443,7 @@ found_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buffer, hb_mask_t /* -> starting from the end of the syllable, move backwards */ i = end; + unsigned int limit = start + (info[start].indic_category() == OT_Ra ? 2 : 0); do { i--; /* -> until a consonant is found */ @@ -457,20 +458,25 @@ found_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buffer, hb_mask_t break; } - /* TODO: or that is not a pre-base reordering Ra, */ - - /* -> or arrive at the first consonant. The consonant stopped at will be the base. */ + /* -> or that is not a pre-base reordering Ra, + * + * o If the syllable starts with Ra + Halant (in a script that has Reph) + * and has more than one consonant, Ra is excluded from candidates for + * base consonants. + * + * IMPLEMENTATION NOTES: + * + * We do this by adjusting limit accordingly before entering the loop. + */ + + /* -> or arrive at the first consonant. The consonant stopped at will + * be the base. */ base = i; } - } while (i > start); + } while (i > limit); if (base < start) base = start; /* Just in case... */ - /* TODO - * If the syllable starts with Ra + Halant (in a script that has Reph) - * and has more than one consonant, Ra is excluded from candidates for - * base consonants. */ - /* 2. Decompose and reorder Matras: * -- 2.7.4