diff options
Diffstat (limited to 'modules/indic')
-rw-r--r-- | modules/indic/indic-lang.c | 90 |
1 files changed, 89 insertions, 1 deletions
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; + } + } } } |