From 18d5d28f70b60d27a6486f5dd6b787fe5ab06737 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 25 Jul 2003 16:11:17 +0000 Subject: Port pre-base-mantra fixup code from ICU, as needed for Tamil and Fri Jul 25 12:07:21 2003 Owen Taylor * modules/indic/mprefixups.[ch] modules/indic/indic-ot.[ch] modules/indic/indic-fc.c: Port pre-base-mantra fixup code from ICU, as needed for Tamil and Malayalam. (Based on patch from Sivaraj Doddannan, #111166) --- modules/indic/indic-fc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'modules/indic/indic-fc.c') diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index 3f905e5e..44832304 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -313,6 +313,7 @@ indic_engine_shape (PangoFont *font, PangoEngineShapeIndic *indic_shape_engine = NULL; PangoIndicInfo *indic_info = NULL; PangoFcFont *fc_font; + MPreFixups *mprefixups; g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); @@ -332,14 +333,15 @@ indic_engine_shape (PangoFont *font, indic_info = indic_shape_engine->indicInfo; wc_in = expand_text (text, length, &utf8_offsets, &n_chars); - n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, NULL, NULL, NULL); - + + n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, NULL, NULL, NULL, NULL); + wc_out = g_new (gunichar, n_glyphs); indices = g_new (glong, n_glyphs); tags = g_new (gulong, n_glyphs); - n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, wc_out, indices, tags); - + n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, wc_out, indices, tags, &mprefixups); + pango_glyph_string_set_size (glyphs, n_glyphs); set_glyphs(font, face, wc_out, n_glyphs, glyphs); @@ -350,6 +352,13 @@ indic_engine_shape (PangoFont *font, pango_ot_ruleset_shape (gsub_ruleset, glyphs, tags); } + /* Fix pre-modifiers for some scripts before base consonant */ + if (mprefixups) + { + indic_mprefixups_apply (mprefixups, glyphs); + indic_mprefixups_free (mprefixups); + } + /* apply default positioning */ for (i = 0; i < glyphs->num_glyphs; i += 1) { -- cgit v1.2.1