From 29531128f2f4342d537817746863705df80efe4b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 15 May 2014 14:04:02 -0600 Subject: [PATCH] [indic] Improve reph formation of Sinhala and Telugu Sinhala and Telugu use "explicit" reph. That is, the reph is formed by a Ra,H,ZWJ sequence. Previously, upon detecting this sequence, we were checking checking whether the 'rphf' feature applies to the first two glyphs of the sequence. This is how the Microsoft fonts are designed. However, testing with Noto shows that apparently Uniscribe also forms the reph if the lookup ligates all three glyphs. So, try both sequences. Doesn't affect test results for Sinhala or Telugu. https://code.google.com/a/google.com/p/noto-alpha/issues/detail?id=232 --- src/hb-ot-shape-complex-indic.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 47ccf7e69..6901fd84f 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -726,8 +726,13 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, )) { /* See if it matches the 'rphf' feature. */ - hb_codepoint_t glyphs[2] = {info[start].codepoint, info[start + 1].codepoint}; - if (indic_plan->rphf.would_substitute (glyphs, ARRAY_LENGTH (glyphs), face)) + hb_codepoint_t glyphs[3] = {info[start].codepoint, + info[start + 1].codepoint, + indic_plan->config->reph_mode == REPH_MODE_EXPLICIT ? + info[start + 2].codepoint : 0}; + if (indic_plan->rphf.would_substitute (glyphs, 2, face) || + (indic_plan->config->reph_mode == REPH_MODE_EXPLICIT && + indic_plan->rphf.would_substitute (glyphs, 3, face))) { limit += 2; while (limit < end && is_joiner (info[limit]))