[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
This commit is contained in:
Behdad Esfahbod 2014-05-15 14:04:02 -06:00
parent 8c703f13bf
commit 29531128f2
1 changed files with 7 additions and 2 deletions

View File

@ -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]))