diff options
Diffstat (limited to 'modules/indic/indic-ot.c')
-rw-r--r-- | modules/indic/indic-ot.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/modules/indic/indic-ot.c b/modules/indic/indic-ot.c index 6243e27a..496932da 100644 --- a/modules/indic/indic-ot.c +++ b/modules/indic/indic-ot.c @@ -168,6 +168,27 @@ static void shiftCharsLeft3(Output *output) } } +static void swapChars(Output *output, int a, int b) +{ + if (output->fOutChars != NULL) { + gunichar temp_char; + guint32 temp_index; + gulong temp_tag; + + temp_char = output->fOutChars[output->fOutIndex + b]; + temp_index = output->fCharIndices[output->fOutIndex + b]; + temp_tag = output->fCharTags[output->fOutIndex + b]; + + output->fOutChars[output->fOutIndex + b] = output->fOutChars[output->fOutIndex + a]; + output->fCharIndices[output->fOutIndex + b] = output->fCharIndices[output->fOutIndex + a]; + output->fCharTags[output->fOutIndex + b] = pstf_p; + + output->fOutChars[output->fOutIndex + a] = temp_char; + output->fCharIndices[output->fOutIndex + a] = temp_index; + output->fCharTags[output->fOutIndex + a] = temp_tag; + } +} + static void writeChar(Output *output, gunichar ch, guint32 charIndex, gulong charTags) { if (output->fOutChars != NULL) { @@ -421,6 +442,15 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c writeChar(&output, chars[i], /*i*/ prev, nukt_p); } + /* for the special conjuction of Cons+0x0d4d+0x0d31 of Malayalam */ + if ((baseConsonant - 2 >= 0) && + (chars[baseConsonant - 1] == 0x0d4d) && + (chars[baseConsonant] == 0x0d31) && + ((chars[baseConsonant - 2] >= 0x0d15) && + (chars[baseConsonant - 2] <= 0x0d39))) { + swapChars (&output, -1, -3); + } + if ((class_table->scriptFlags & SF_MATRAS_AFTER_BASE) != 0) { writeMbelow(&output); writeMabove(&output); @@ -467,7 +497,7 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c /* write halant that was after base consonant */ writeChar(&output, chars[bcSpan], /*bcSpan*/ prev, blwf_p); - //for Ra of malayalam + /* for Ra of Malayalam */ if ((bcSpan - 1 >= 0) && (bcSpan + 1 < char_count) && (chars[bcSpan] == 0x0d4d) && (chars[bcSpan + 1] == 0x0d30) && ((chars[bcSpan - 1] >= 0x0d15) && (chars[bcSpan - 1] <= 0x0d39))) { |