[Indic] Implement Sinhala "Al Lakuna" Reph behavior

In Sinhala, Reph is formed only explicitly, by the presence of a ZWJ.
This commit is contained in:
Behdad Esfahbod 2012-07-18 17:22:14 -04:00
parent 91cade7555
commit 3285e107c9
4 changed files with 12 additions and 1 deletions

View File

@ -269,6 +269,8 @@ static const hb_codepoint_t ra_chars[] = {
0x0CB0, /* Kannada */
0x0D30, /* Malayalam */ /* No Reph, Logical Repha */
0x0DBB, /* Sinhala */ /* Reph formed only with ZWJ */
0x179A, /* Khmer */ /* No Reph, Visual Repha */
};

View File

@ -356,9 +356,14 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff
start + 3 <= end &&
info[start].indic_category() == OT_Ra &&
info[start + 1].indic_category() == OT_H &&
!is_joiner (info[start + 2]))
(unlikely (buffer->props.script == HB_SCRIPT_SINHALA) ?
info[start + 2].indic_category() == OT_ZWJ /* In Sinhala, form Reph only if ZWJ is present */:
!is_joiner (info[start + 2] /* In other scripts, any joiner blocks Reph formation */ )
))
{
limit += 2;
while (limit < end && is_joiner (info[limit]))
limit++;
base = start;
has_reph = true;
};

View File

@ -0,0 +1,3 @@
ර්ධ
ර්‍ධ
ර්‌ධ