From 10cdc94eee2225f14c198c015256a5a0063eecad Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 Jul 2012 17:42:34 -0400 Subject: [PATCH] [Indic] In final reordering, find base, even if it disappeared POS_BASE can disappear if base ligated backward. Define base as last with position not after base. Fixes a few hundred of Sinhala failures with Iskoola Pota. --- src/hb-ot-shape-complex-indic.cc | 7 ++----- .../texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index c0d56eb..2aaac54 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -705,11 +705,8 @@ final_reordering_syllable (hb_buffer_t *buffer, /* Find base again */ unsigned int base = end; - for (unsigned int i = start; i < end; i++) - if (info[i].indic_position() == POS_BASE_C) { - base = i; - break; - } + while (start < base && info[base - 1].indic_position() >= POS_BASE_C) + base--; unsigned int start_of_last_cluster = base; 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 0d772a7..a8491bf 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 @@ -4,3 +4,4 @@ කේ කෝ කෝ +ස්ට්‍රේ -- 2.7.4