diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 80bdb31bd..ad1cadaae 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -576,17 +576,17 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff info[i].indic_position() = POS_BELOW_C; } - if (base < start) - base = start; /* Just in case... */ - /* -> 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. */ - if (has_reph && base == start) { + * base consonants. + * + * Only do this for unforced Reph. (ie. not for Ra,H,ZWJ. */ + if (has_reph && base == start && start + 2 == limit) { /* Have no other consonant, so Reph is not formed and Ra becomes base. */ has_reph = false; } } + if (base < end) info[base].indic_position() = POS_BASE_C; diff --git a/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt b/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt index a54967390..c8c939a26 100644 --- a/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt +++ b/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt @@ -35,3 +35,4 @@ න්ගේ න්‍ගේ න‍්ගේ +ර්‍