[Indic] Simplify Reph logic
This commit is contained in:
parent
3d25079f8d
commit
6d8e0cb74c
|
@ -237,9 +237,10 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff
|
||||||
* base consonants. */
|
* base consonants. */
|
||||||
unsigned int limit = start;
|
unsigned int limit = start;
|
||||||
if (mask_array[RPHF] &&
|
if (mask_array[RPHF] &&
|
||||||
start + 2 < end &&
|
start + 3 <= end &&
|
||||||
info[start].indic_category() == OT_Ra &&
|
info[start].indic_category() == OT_Ra &&
|
||||||
info[start + 1].indic_category() == OT_H)
|
info[start + 1].indic_category() == OT_H &&
|
||||||
|
!is_joiner (info[start + 2]))
|
||||||
{
|
{
|
||||||
limit += 2;
|
limit += 2;
|
||||||
base = start;
|
base = start;
|
||||||
|
@ -267,15 +268,6 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* -> o If the syllable starts with Ra + Halant (in a script that has Reph)
|
|
||||||
* and has more than one consonant, Ra is excluded from candidates for
|
|
||||||
* base consonants.
|
|
||||||
*
|
|
||||||
* IMPLEMENTATION NOTES:
|
|
||||||
*
|
|
||||||
* We do this by adjusting limit accordingly before entering the loop.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* -> or arrive at the first consonant. The consonant stopped at will
|
/* -> or arrive at the first consonant. The consonant stopped at will
|
||||||
* be the base. */
|
* be the base. */
|
||||||
base = i;
|
base = i;
|
||||||
|
@ -296,8 +288,6 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 2. Decompose and reorder Matras:
|
/* 2. Decompose and reorder Matras:
|
||||||
*
|
*
|
||||||
* Each matra and any syllable modifier sign in the cluster are moved to the
|
* Each matra and any syllable modifier sign in the cluster are moved to the
|
||||||
|
@ -336,15 +326,11 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff
|
||||||
info[i].indic_position() = POS_PRE_C;
|
info[i].indic_position() = POS_PRE_C;
|
||||||
info[base].indic_position() = POS_BASE_C;
|
info[base].indic_position() = POS_BASE_C;
|
||||||
|
|
||||||
|
|
||||||
/* Handle beginning Ra */
|
/* Handle beginning Ra */
|
||||||
if (has_reph &&
|
if (has_reph) {
|
||||||
start + 3 <= end &&
|
|
||||||
!is_joiner (info[start + 2]))
|
|
||||||
{
|
|
||||||
info[start].indic_position() = POS_REPH;
|
info[start].indic_position() = POS_REPH;
|
||||||
info[start].mask = mask_array[RPHF];
|
info[start].mask = mask_array[RPHF];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For old-style Indic script tags, move the first post-base Halant after
|
/* For old-style Indic script tags, move the first post-base Halant after
|
||||||
* last consonant. */
|
* last consonant. */
|
||||||
|
|
Loading…
Reference in New Issue