From 824d232bb96e8fd98aac939bcd4c878cf26db410 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 31 Jul 2006 22:37:43 +0000 Subject: =?UTF-8?q?Bug=20121672=20=E2=80=93=20Ra=20(vattu)=20not=20rendere?= =?UTF-8?q?d=20properly=20in=20Malayalam=20Patch=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-07-31 Behdad Esfahbod Bug 121672 – Ra (vattu) not rendered properly in Malayalam Patch from LingNing Zhang * modules/indic/indic-ot.c (shiftCharsLeft3), (indic_ot_reorder): Reorder combinations of some three chars! --- ChangeLog | 8 ++++++++ modules/indic/indic-ot.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/ChangeLog b/ChangeLog index a8aa551d..3de44cd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-07-31 Behdad Esfahbod + + Bug 121672 – Ra (vattu) not rendered properly in Malayalam + Patch from LingNing Zhang + + * modules/indic/indic-ot.c (shiftCharsLeft3), (indic_ot_reorder): + Reorder combinations of some three chars! + 2006-07-31 Behdad Esfahbod Bug 335811 – Some conjugates of Malayalam are wrong. diff --git a/modules/indic/indic-ot.c b/modules/indic/indic-ot.c index 188e5fc5..6243e27a 100644 --- a/modules/indic/indic-ot.c +++ b/modules/indic/indic-ot.c @@ -142,6 +142,32 @@ static void noteBaseConsonant(Output *output) indic_mprefixups_add(output->fMPreFixups, output->fOutIndex, output->fMPreOutIndex); } } + +static void shiftCharsLeft3(Output *output) +{ + if (output->fOutChars != NULL) { + gunichar temp_char; + guint32 temp_index; + gulong temp_tag; + + temp_char = output->fOutChars[output->fOutIndex - 3]; + temp_index = output->fCharIndices[output->fOutIndex - 3]; + temp_tag = output->fCharTags[output->fOutIndex - 3]; + + output->fOutChars[output->fOutIndex - 3] = output->fOutChars[output->fOutIndex - 2]; + output->fCharIndices[output->fOutIndex - 3] = output->fCharIndices[output->fOutIndex - 2]; + output->fCharTags[output->fOutIndex - 3] = output->fCharTags[output->fOutIndex - 2]; + + output->fOutChars[output->fOutIndex - 2] = output->fOutChars[output->fOutIndex - 1]; + output->fCharIndices[output->fOutIndex - 2] = output->fCharIndices[output->fOutIndex - 1]; + output->fCharTags[output->fOutIndex - 2] = output->fCharTags[output->fOutIndex - 1]; + + output->fOutChars[output->fOutIndex - 1] = temp_char; + output->fCharIndices[output->fOutIndex - 1] = temp_index; + output->fCharTags[output->fOutIndex - 1] = temp_tag; + } +} + static void writeChar(Output *output, gunichar ch, guint32 charIndex, gulong charTags) { if (output->fOutChars != NULL) { @@ -440,6 +466,14 @@ 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 + if ((bcSpan - 1 >= 0) && (bcSpan + 1 < char_count) && + (chars[bcSpan] == 0x0d4d) && (chars[bcSpan + 1] == 0x0d30) && + ((chars[bcSpan - 1] >= 0x0d15) && (chars[bcSpan - 1] <= 0x0d39))) { + + shiftCharsLeft3 (&output); + } } /* write the training halant, if there is one */ -- cgit v1.2.1