From ecd454b3cd75050e0c95e1d2aa55744559338ec8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 8 Jan 2013 18:09:46 -0600 Subject: [PATCH] [Indic] In old-spec shaping, don't move viramas around if seq ends with one For example: u0c9a u0ccd u0c9a u0ccd with Lohit. See: https://bugs.freedesktop.org/show_bug.cgi?id=59118 --- src/hb-ot-shape-complex-indic.cc | 7 ++++--- .../shaper-indic/indic/script-kannada/misc/misc.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 1bc8a773e..5afede0c1 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -644,15 +644,16 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, info[start].indic_position() = POS_RA_TO_BECOME_REPH; /* For old-style Indic script tags, move the first post-base Halant after - * last consonant. */ + * last consonant. Only do this if there is *not* a Halant after last + * consonant. Otherwise it becomes messy. */ if (indic_plan->is_old_spec) { for (unsigned int i = base + 1; i < end; i++) if (info[i].indic_category() == OT_H) { unsigned int j; for (j = end - 1; j > i; j--) - if (is_consonant (info[j])) + if (is_consonant (info[j]) || info[j].indic_category() == OT_H) break; - if (j > i) { + if (info[j].indic_category() != OT_H && j > i) { /* Move Halant to after last consonant. */ hb_glyph_info_t t = info[i]; memmove (&info[i], &info[i + 1], (j - i) * sizeof (info[0])); diff --git a/test/shaping/texts/in-tree/shaper-indic/indic/script-kannada/misc/misc.txt b/test/shaping/texts/in-tree/shaper-indic/indic/script-kannada/misc/misc.txt index 19bec8c99..a8a632505 100644 --- a/test/shaping/texts/in-tree/shaper-indic/indic/script-kannada/misc/misc.txt +++ b/test/shaping/texts/in-tree/shaper-indic/indic/script-kannada/misc/misc.txt @@ -17,3 +17,4 @@ ಕೋ ಕ್ಷ ಕ್ಷಿ +ಚ್ಚ್