summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-12-08 21:29:27 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-12-08 21:29:27 +0000
commit45dd6dd92055e7b44bb74017fd13771eba5257e4 (patch)
tree4bcb54d99fc56d94ecf8ec5e899eb238c0e8c1fd
parent7e2ca8cae0d8a2f29ce10d9b5977dd94925c7823 (diff)
downloadpango-45dd6dd92055e7b44bb74017fd13771eba5257e4.tar.gz
Red Hat Bug 211574: [hi/ml/si_LK] cursor naviation is wrong when using ZWJ
2006-12-08 Behdad Esfahbod <behdad@gnome.org> Red Hat Bug 211574: [hi/ml/si_LK] cursor naviation is wrong when using ZWJ (200d) Patch from LingNing Zhang * modules/indic/indic-lang.c (indic_engine_break): Handle cursor movement around ZWJ and ZWNJ.
-rw-r--r--ChangeLog9
-rw-r--r--modules/indic/indic-lang.c90
2 files changed, 98 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d2eeee6..011a8c54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-12-08 Behdad Esfahbod <behdad@gnome.org>
+
+ Red Hat Bug 211574: [hi/ml/si_LK] cursor naviation is wrong when
+ using ZWJ (200d)
+ Patch from LingNing Zhang
+
+ * modules/indic/indic-lang.c (indic_engine_break): Handle cursor
+ movement around ZWJ and ZWNJ.
+
2006-12-07 Behdad Esfahbod <behdad@gnome.org>
* === Released 1.14.9 ===
diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c
index c03b9184..3c9a21e4 100644
--- a/modules/indic/indic-lang.c
+++ b/modules/indic/indic-lang.c
@@ -39,12 +39,46 @@ static PangoEngineScriptInfo deva_scripts[] = {
{ PANGO_SCRIPT_DEVANAGARI, "*" }
};
+static PangoEngineScriptInfo beng_scripts[] = {
+ { PANGO_SCRIPT_BENGALI, "*" }
+};
+
+static PangoEngineScriptInfo guru_scripts[] = {
+ { PANGO_SCRIPT_GURMUKHI, "*" }
+};
+
+static PangoEngineScriptInfo gujr_scripts[] = {
+ { PANGO_SCRIPT_GUJARATI, "*" }
+};
+
+static PangoEngineScriptInfo orya_scripts[] = {
+ { PANGO_SCRIPT_ORIYA, "*" }
+};
+
+static PangoEngineScriptInfo taml_scripts[] = {
+ { PANGO_SCRIPT_TAMIL, "*" }
+};
+
+static PangoEngineScriptInfo telu_scripts[] = {
+ { PANGO_SCRIPT_TELUGU, "*" }
+};
+
+static PangoEngineScriptInfo knda_scripts[] = {
+ { PANGO_SCRIPT_KANNADA, "*" }
+};
+
+static PangoEngineScriptInfo mlym_scripts[] = {
+ { PANGO_SCRIPT_MALAYALAM, "*" }
+};
+
static PangoEngineScriptInfo sinh_scripts[] = {
{ PANGO_SCRIPT_SINHALA, "*" }
};
static PangoEngineInfo script_engines[] = {
- INDIC_ENGINE_INFO(deva),
+ INDIC_ENGINE_INFO(deva), INDIC_ENGINE_INFO(beng), INDIC_ENGINE_INFO(guru),
+ INDIC_ENGINE_INFO(gujr), INDIC_ENGINE_INFO(orya), INDIC_ENGINE_INFO(taml),
+ INDIC_ENGINE_INFO(telu), INDIC_ENGINE_INFO(knda), INDIC_ENGINE_INFO(mlym),
INDIC_ENGINE_INFO(sinh)
};
@@ -119,6 +153,60 @@ indic_engine_break (PangoEngineLang *engine,
attrs[i].is_line_break = FALSE;
attrs[i].is_mandatory_break = FALSE;
}
+ else if (prev_wc != 0 && (this_wc == 0x200D || this_wc == 0x200C))
+ {
+ if (next_wc != 0)
+ {
+ if (next_next_wc == 0)
+ {
+ attrs[i].is_cursor_position = FALSE;
+ attrs[i].is_char_break = FALSE;
+ attrs[i].is_line_break = FALSE;
+ attrs[i].is_mandatory_break = FALSE;
+
+ i++;
+
+ attrs[i].is_cursor_position = FALSE;
+ attrs[i].is_char_break = FALSE;
+ attrs[i].is_line_break = FALSE;
+ attrs[i].is_mandatory_break = FALSE;
+ }
+ else if ((next_next_wc != 0) &&
+ (next_wc == 0x09CD || /* Bengali */
+ next_wc == 0x0ACD || /* Gujarati */
+ next_wc == 0x094D || /* Hindi */
+ next_wc == 0x0CCD || /* Kannada */
+ next_wc == 0x0D4D || /* Malayalam */
+ next_wc == 0x0B4D || /* Oriya */
+ next_wc == 0x0A4D || /* Punjabi */
+ next_wc == 0x0BCD || /* Tamil */
+ next_wc == 0x0C4D || /* Telugu */
+ next_wc == 0x0DCA)) /*Sinhala*/
+ {
+ attrs[i].is_cursor_position = FALSE;
+ attrs[i].is_char_break = FALSE;
+ attrs[i].is_line_break = FALSE;
+ attrs[i].is_mandatory_break = FALSE;
+
+ i++;
+
+ attrs[i].is_cursor_position = FALSE;
+ attrs[i].is_char_break = FALSE;
+ attrs[i].is_line_break = FALSE;
+ attrs[i].is_mandatory_break = FALSE;
+
+ i++;
+ attrs[i].is_cursor_position = FALSE;
+ }
+ }
+ else
+ {
+ attrs[i].is_cursor_position = FALSE;
+ attrs[i].is_char_break = FALSE;
+ attrs[i].is_line_break = FALSE;
+ attrs[i].is_mandatory_break = FALSE;
+ }
+ }
}
}