summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-07-31 22:37:43 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-07-31 22:37:43 +0000
commit824d232bb96e8fd98aac939bcd4c878cf26db410 (patch)
tree7a33748a1d7d8ff2e7f5f5a1c91ef123199042d8 /modules
parent67b73531067f9866c55774a08f9e982fb928e649 (diff)
downloadpango-824d232bb96e8fd98aac939bcd4c878cf26db410.tar.gz
Bug 121672 – Ra (vattu) not rendered properly in Malayalam Patch from
2006-07-31 Behdad Esfahbod <behdad@gnome.org> 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!
Diffstat (limited to 'modules')
-rw-r--r--modules/indic/indic-ot.c34
1 files changed, 34 insertions, 0 deletions
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 */