From 56be677781736bbedc80df6f6aaa2b5f0bc4041c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Nov 2012 14:09:40 -0800 Subject: [PATCH] [Indic] Port 'pref' logic to look into font tables ...instead of using a hardcoded list of Ra characters. --- src/hb-ot-shape-complex-indic.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 36da94808..73a68fe5a 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -734,9 +734,9 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, if (indic_plan->mask_array[PREF] && base + 2 < end) { /* Find a Halant,Ra sequence and mark it for pre-base reordering processing. */ - for (unsigned int i = base + 1; i + 1 < end; i++) - if (is_halant_or_coeng (info[i + (indic_plan->is_old_spec ? 1 : 0)]) && - info[i + (indic_plan->is_old_spec ? 0 : 1)].indic_category() == OT_Ra) + for (unsigned int i = base + 1; i + 1 < end; i++) { + hb_codepoint_t glyphs[2] = {info[i].codepoint, info[i + 1].codepoint}; + if (indic_plan->pref.would_substitute (glyphs, ARRAY_LENGTH (glyphs), true, face)) { info[i++].mask |= indic_plan->mask_array[PREF]; info[i++].mask |= indic_plan->mask_array[PREF]; @@ -752,6 +752,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, break; } + } } /* Apply ZWJ/ZWNJ effects */