diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-12-08 21:28:41 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-12-08 21:28:41 +0000 |
commit | e2c914724b527154d44e2c7f012bbca5c866491f (patch) | |
tree | a2791487538460f470b09d19cd08f232b13a9513 | |
parent | f41604ffcaaae2f34ad989ccbe09f2f38e665146 (diff) | |
download | pango-e2c914724b527154d44e2c7f012bbca5c866491f.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-- | ChangeLog | 9 | ||||
-rw-r--r-- | modules/indic/indic-lang.c | 90 |
2 files changed, 98 insertions, 1 deletions
@@ -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> Red Hat Bug 216424: [te_IN] pango - consonant + dependent vowel (ai) 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; + } + } } } |