[Indic] Better position left-matra in Malayalam

Just put it before base, which is what's expected.

Malayalam failures down from 1559 to 1197 (0.114172%).

BENGALI: 353988 out of 354285 tests passed. 297 failed (0.0838308%)
DEVANAGARI: 693571 out of 693628 tests passed. 57 failed (0.00821766%)
GUJARATI: 366489 out of 366506 tests passed. 17 failed (0.0046384%)
GURMUKHI: 60750 out of 60809 tests passed. 59 failed (0.0970251%)
KANNADA: 950956 out of 951913 tests passed. 957 failed (0.100534%)
KHMER: 299094 out of 299124 tests passed. 30 failed (0.0100293%)
MALAYALAM: 1047219 out of 1048416 tests passed. 1197 failed (0.114172%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271699 out of 271847 tests passed. 148 failed (0.0544424%)
TAMIL: 1091837 out of 1091837 tests passed. 0 failed (0%)
TELUGU: 970524 out of 970573 tests passed. 49 failed (0.00504856%)
This commit is contained in:
Behdad Esfahbod 2012-07-24 03:36:47 -04:00
parent 88f413b56f
commit 65c43accdc
2 changed files with 30 additions and 14 deletions

View File

@ -895,22 +895,37 @@ final_reordering_syllable (hb_buffer_t *buffer,
* halant, position is moved after it.
*/
if (start < base) /* Otherwise there can't be any pre-base matra characters. */
if (start + 1 < end && start < base) /* Otherwise there can't be any pre-base matra characters. */
{
unsigned int new_pos = base - 1;
while (new_pos > start &&
!(is_one_of (info[new_pos], (FLAG (OT_M) | FLAG (OT_H) | FLAG (OT_Coeng)))))
new_pos--;
/* If we found no Halant we are done (just need to update clusters).
* Otherwise only proceed if the Halant does
* not belong to the Matra itself! */
if (is_halant_or_coeng (info[new_pos]) &&
info[new_pos].indic_position() != POS_PRE_M)
{
/* -> If ZWJ or ZWNJ follow this halant, position is moved after it. */
if (new_pos + 1 < end && is_joiner (info[new_pos + 1]))
new_pos++;
/* If we lost track of base, alas, position before last thingy. */
unsigned int new_pos = base == end ? base - 2 : base - 1;
/* Malayalam does not have "half" forms or explicit virama forms.
* The glyphs formed by 'half' are Chillus. We want to position
* matra after them all.
*/
if (buffer->props.script != HB_SCRIPT_MALAYALAM)
{
while (new_pos > start &&
!(is_one_of (info[new_pos], (FLAG (OT_M) | FLAG (OT_H) | FLAG (OT_Coeng)))))
new_pos--;
/* If we found no Halant we are done.
* Otherwise only proceed if the Halant does
* not belong to the Matra itself! */
if (is_halant_or_coeng (info[new_pos]) &&
info[new_pos].indic_position() != POS_PRE_M)
{
/* -> If ZWJ or ZWNJ follow this halant, position is moved after it. */
if (new_pos + 1 < end && is_joiner (info[new_pos + 1]))
new_pos++;
}
else
new_pos = start; /* No move. */
}
if (start < new_pos)
{
/* Now go see if there's actually any matras... */
for (unsigned int i = new_pos; i > start; i--)
if (info[i - 1].indic_position () == POS_PRE_M)

View File

@ -58,3 +58,4 @@
ള്‍
ള്യം
ള്ള
ല്‍പ്പേ