From 92a1ad7bef9efb456ab87bd63818cfbed7da3f6f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 20 Jul 2012 18:38:27 -0400 Subject: [PATCH] [Indic] Stop searching for base if a post form is found before below form Improves Bengali and Gurmukhi. Malayalam regressed a bit. We will deal with that later. --- src/hb-ot-shape-complex-indic.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index b5ad4ae1f..ad55f77db 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -505,6 +505,7 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff { /* -> starting from the end of the syllable, move backwards */ unsigned int i = end; + bool seen_below = false; do { i--; /* -> until a consonant is found */ @@ -513,11 +514,13 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff /* -> that does not have a below-base or post-base form * (post-base forms have to follow below-base forms), */ if (info[i].indic_position() != POS_BELOW_C && - info[i].indic_position() != POS_POST_C) + (info[i].indic_position() != POS_POST_C || seen_below)) { base = i; break; } + if (info[i].indic_position() == POS_BELOW_C) + seen_below = true; /* -> or that is not a pre-base reordering Ra, *