diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-09-13 23:06:14 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-09-13 23:06:14 +0000 |
commit | 681941ee9ffa783303a1f34025a956db96865a1d (patch) | |
tree | 1ef7d712395e250d0257976a7aa77a67bfad0c04 /modules | |
parent | 5336235fc5aefe54754fd5cb6328dd453430c151 (diff) | |
download | pango-681941ee9ffa783303a1f34025a956db96865a1d.tar.gz |
Bug 351223 – the conjuction of Con + 0x0d4d +0x0d31 of Malayalam is
2006-09-13 Behdad Esfahbod <behdad@gnome.org>
Bug 351223 – the conjuction of Con + 0x0d4d +0x0d31 of Malayalam is
wrong
Patch from LingNing Zhang
* modules/indic/indic-ot.c (swapChars), (indic_ot_reorder): Special
case the above case.
Diffstat (limited to 'modules')
-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))) { |