diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-01-16 20:07:35 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-01-16 20:07:35 +0000 |
commit | 80e647a8dbc97662b9d966c0f7a8e1aedea89eed (patch) | |
tree | d3a322c28112b7623765847aa32e8e319c576b45 /modules | |
parent | e6b83e4264b4ad2ab73a3239d902b4064c75634d (diff) | |
download | pango-80e647a8dbc97662b9d966c0f7a8e1aedea89eed.tar.gz |
*.c, *.h: Drop trailing whitespace.
2007-01-16 Behdad Esfahbod <behdad@gnome.org>
*.c, *.h: Drop trailing whitespace.
svn path=/trunk/; revision=2163
Diffstat (limited to 'modules')
27 files changed, 463 insertions, 463 deletions
diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c index 260d1096..27670959 100644 --- a/modules/arabic/arabic-fc.c +++ b/modules/arabic/arabic-fc.c @@ -57,7 +57,7 @@ maybe_add_gsub_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, tag, script_index, 0xffff, &feature_index)) @@ -73,7 +73,7 @@ maybe_add_gpos_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GPOS, tag, script_index, 0xffff, &feature_index)) @@ -91,7 +91,7 @@ get_ruleset (FT_Face face) if (!ruleset_quark) ruleset_quark = g_quark_from_string ("pango-arabic-ruleset"); - + if (!info) return NULL; @@ -148,16 +148,16 @@ static void swap_range (PangoGlyphString *glyphs, int start, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -171,7 +171,7 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl glyphs->log_clusters[i] = offset; } -static void +static void fallback_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -183,10 +183,10 @@ fallback_shape (PangoEngineShape *engine, glong n_chars = g_utf8_strlen (text, length); const char *p; int i; - + pango_glyph_string_set_size (glyphs, n_chars); p = text; - + for (i=0; i < n_chars; i++) { gunichar wc; @@ -200,7 +200,7 @@ fallback_shape (PangoEngineShape *engine, if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); } @@ -217,7 +217,7 @@ fallback_shape (PangoEngineShape *engine, set_glyph (font, glyphs, i, p - text, index); } - + p = g_utf8_next_char (p); } @@ -227,17 +227,17 @@ fallback_shape (PangoEngineShape *engine, if (glyphs->glyphs[i].glyph) { PangoRectangle logical_rect; - + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect); glyphs->glyphs[i].geometry.width = logical_rect.width; } else glyphs->glyphs[i].geometry.width = 0; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; } - + if (analysis->level % 2 != 0) { /* Swap all glyphs */ @@ -245,7 +245,7 @@ fallback_shape (PangoEngineShape *engine, } } -static void +static void arabic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -284,14 +284,14 @@ arabic_engine_shape (PangoEngineShape *engine, buffer = pango_ot_buffer_new (fc_font); pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); pango_ot_buffer_set_zero_width_marks (buffer, TRUE); - + wcs = g_utf8_to_ucs4_fast (text, length, &n_chars); properties = g_new0 (gulong, n_chars); - + Arabic_Assign_Properties (wcs, properties, n_chars); g_free (wcs); - + p = text; for (i=0; i < n_chars; i++) { @@ -306,7 +306,7 @@ arabic_engine_shape (PangoEngineShape *engine, if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); } @@ -325,7 +325,7 @@ arabic_engine_shape (PangoEngineShape *engine, if (wc == 0x6cc && ruleset && pango_fc_font_get_glyph (fc_font, 0x64a) && ((properties[i] & (initial | medial)) != (initial | medial))) wc = 0x64a; - + index = pango_fc_font_get_glyph (fc_font, wc); if (!index) @@ -337,19 +337,19 @@ arabic_engine_shape (PangoEngineShape *engine, { if (g_unichar_type (wc) != G_UNICODE_NON_SPACING_MARK) cluster = p - text; - + pango_ot_buffer_add_glyph (buffer, index, properties[i], cluster); } } - + p = g_utf8_next_char (p); } pango_ot_ruleset_substitute (ruleset, buffer); pango_ot_ruleset_position (ruleset, buffer); pango_ot_buffer_output (buffer, glyphs); - + g_free (properties); pango_ot_buffer_destroy (buffer); @@ -366,18 +366,18 @@ arabic_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (ArabicEngineFc, arabic_engine_fc, arabic_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { arabic_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/arabic/arabic-lang.c b/modules/arabic/arabic-lang.c index 4d458442..885977c4 100644 --- a/modules/arabic/arabic-lang.c +++ b/modules/arabic/arabic-lang.c @@ -123,18 +123,18 @@ arabic_engine_lang_class_init (PangoEngineLangClass *class) PANGO_ENGINE_LANG_DEFINE_TYPE (ArabicEngineLang, arabic_engine_lang, arabic_engine_lang_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { arabic_engine_lang_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/arabic/arabic-ot.c b/modules/arabic/arabic-ot.c index a87c0de8..bf7cd070 100644 --- a/modules/arabic/arabic-ot.c +++ b/modules/arabic/arabic-ot.c @@ -272,7 +272,7 @@ TT_Error Build_Arabic_Glyph_Properties (TT_CharMap char_map, * * R7: If R1-R6 fail: * - * <anything> -> [isolated] + * <anything> -> [isolated] */ /* `direction' can be -1, 0, or 1 to indicate the last non-transparent diff --git a/modules/arabic/arabic.c b/modules/arabic/arabic.c index 74131bff..9b6aae75 100644 --- a/modules/arabic/arabic.c +++ b/modules/arabic/arabic.c @@ -1,9 +1,9 @@ -/* Pango - Arabic module +/* Pango - Arabic module * arabic module * * (C) 2000 Karl Koehler<koehler@or.uni-bonn.de> - * Owen Taylor <otaylor@redhat.com> - * + * Owen Taylor <otaylor@redhat.com> + * */ #include <stdio.h> @@ -12,7 +12,7 @@ #include "pango-engine.h" #include "pangox.h" -#include "arconv.h" +#include "arconv.h" #include "mulefont.h" #include "langboxfont.h" #include "naqshfont.h" @@ -44,7 +44,7 @@ static gint n_script_engines = G_N_ELEMENTS (script_engines); static ArabicFontInfo* arabic_unicodeinit(PangoFont *font, PangoXSubfont subfont) -{ +{ ArabicFontInfo *fs = NULL; if (subfont != 0) @@ -65,7 +65,7 @@ arabic_unicodeinit(PangoFont *font, PangoXSubfont subfont) if ( pango_x_has_glyph /* Lam-Min alone */ (font,PANGO_X_MAKE_GLYPH(subfont,0xFC42))) { - fs->level |= ar_lig; + fs->level |= ar_lig; /* extra ligatures in font, hopefully */ } } @@ -77,26 +77,26 @@ static ArabicFontInfo* find_unic_font (PangoFont *font) { static char *charsets[] = { - "iso10646-1", + "iso10646-1", "iso8859-6.8x", "mulearabic-2", "urdunaqsh-0", /* "symbol-0" */ }; - + ArabicFontInfo *fs = NULL; PangoXSubfont *subfonts; int *subfont_charsets; int n_subfonts; int i; - + GQuark info_id = g_quark_from_string ("arabic-font-info"); fs = g_object_get_qdata (G_OBJECT (font), info_id); if (fs) return fs; - n_subfonts = pango_x_list_subfonts (font, charsets, 4, + n_subfonts = pango_x_list_subfonts (font, charsets, 4, &subfonts, &subfont_charsets); - + for (i=0; i < n_subfonts; i++) { if ( !strcmp (charsets[subfont_charsets[i]], "mulearabic-2")) @@ -112,23 +112,23 @@ find_unic_font (PangoFont *font) if (getenv("PANGO_AR_NOLBOXFONT") == NULL ) #endif fs = arabic_lboxinit(font); - } + } else if ( !strcmp (charsets[subfont_charsets[i]], "urdunaqsh-0")) { #ifdef DEBUG if (getenv("PANGO_AR_NONQFONT") == NULL ) #endif fs = urdu_naqshinit(font); - } + } else - { + { #ifdef DEBUG if (getenv("PANGO_AR_NOUNIFONT") == NULL ) #endif fs = arabic_unicodeinit(font,subfonts[i]); } - if (fs){ - g_object_set_qdata_full (G_OBJECT (font), info_id, + if (fs){ + g_object_set_qdata_full (G_OBJECT (font), info_id, fs, (GDestroyNotify)g_free); break; } @@ -143,14 +143,14 @@ find_unic_font (PangoFont *font) static void -set_glyph (PangoGlyphString *glyphs, +set_glyph (PangoGlyphString *glyphs, PangoFont *font, PangoXSubfont subfont, int i, int cluster_start, int glyph, int is_vowel) { PangoRectangle logical_rect; glyphs->glyphs[i].glyph = PANGO_X_MAKE_GLYPH (subfont, glyph); - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; @@ -169,11 +169,11 @@ set_glyph (PangoGlyphString *glyphs, /* The following thing is actually critical ... */ -static void -arabic_engine_shape (PangoFont *font, +static void +arabic_engine_shape (PangoFont *font, const char *text, int length, - PangoAnalysis *analysis, + PangoAnalysis *analysis, PangoGlyphString *glyphs) { PangoXSubfont subfont; @@ -191,20 +191,20 @@ arabic_engine_shape (PangoFont *font, /* We hope there is a suitible font installed .. */ - + if (! (fs = find_unic_font (font)) ) { PangoGlyph unknown_glyph = pango_x_get_unknown_glyph (font); - + n_chars = g_utf8_strlen(text,length); pango_glyph_string_set_size (glyphs, n_chars); p = text; for (i=0; i<n_chars; i++) { - set_glyph (glyphs, font, - PANGO_X_GLYPH_SUBFONT (unknown_glyph), i, + set_glyph (glyphs, font, + PANGO_X_GLYPH_SUBFONT (unknown_glyph), i, p - text, PANGO_X_GLYPH_INDEX (unknown_glyph),0); p = g_utf8_next_char (p); } @@ -216,12 +216,12 @@ arabic_engine_shape (PangoFont *font, if (analysis->level % 2 == 0) { wc = g_utf8_to_ucs4_fast(text,length,&n_chars); - /* We were called on a LTR directional run (e.g. some numbers); + /* We were called on a LTR directional run (e.g. some numbers); fallback as simple as possible */ pango_glyph_string_set_size (glyphs, n_chars); } - else + else { wc = (gunichar *)g_malloc(sizeof(gunichar)* (length) ); /* length is succicient: all arabic chars use at least 2 bytes in utf-8 encoding */ @@ -233,7 +233,7 @@ arabic_engine_shape (PangoFont *font, p = text; pold = p; - i = 0; + i = 0; subfont = fs->subfonts[0]; while(i < n_chars) @@ -243,11 +243,11 @@ arabic_engine_shape (PangoFont *font, p = g_utf8_next_char (p); #ifdef DEBUG fprintf(stderr,"NULL-character detected in generated string.!"); -#endif +#endif i++; } - else - { + else + { int cluster_start ; int is_vowel = arabic_isvowel(wc[i]); cluster_start = is_vowel ? pold - text : p - text; @@ -265,7 +265,7 @@ arabic_engine_shape (PangoFont *font, &(wc[i+1]), fs->subfonts); } - else + else arabic_lbox_recode(&subfont,&(wc[i]),NULL, fs->subfonts); } @@ -277,14 +277,14 @@ arabic_engine_shape (PangoFont *font, &(wc[i+1]), fs->subfonts); } - else + else urdu_naqsh_recode(&subfont,&(wc[i]),NULL, fs->subfonts); } - + set_glyph(glyphs, font, subfont, n_chars - i - 1, cluster_start, wc[i], is_vowel); - + pold = p; p = g_utf8_next_char (p); i++; @@ -314,7 +314,7 @@ static PangoEngine * arabic_engine_x_new () { PangoEngineShape *result; - + result = g_new (PangoEngineShape, 1); result->engine.id = "ArabicScriptEngine"; @@ -339,7 +339,7 @@ arabic_engine_x_new () #define MODULE_ENTRY(func) func #endif -void +void MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, int *n_engines) { *engines = script_engines; @@ -355,7 +355,7 @@ MODULE_ENTRY(script_engine_load) (const char *id) return NULL; } -void +void MODULE_ENTRY(script_engine_unload) (PangoEngine *engine) { } diff --git a/modules/basic/basic-atsui.c b/modules/basic/basic-atsui.c index b394102c..352c582e 100644 --- a/modules/basic/basic-atsui.c +++ b/modules/basic/basic-atsui.c @@ -63,7 +63,7 @@ static PangoEngineScriptInfo basic_scripts[] = { { PANGO_SCRIPT_SHAVIAN, "*" }, { PANGO_SCRIPT_LINEAR_B, "*" }, { PANGO_SCRIPT_UGARITIC, "*" }, - + { PANGO_SCRIPT_COMMON, "" } }; @@ -86,7 +86,7 @@ set_glyph (PangoFont *font, PangoRectangle logical_rect; glyphs->glyphs[i].glyph = glyph; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; @@ -95,7 +95,7 @@ set_glyph (PangoFont *font, glyphs->glyphs[i].geometry.width = logical_rect.width; } -static void +static void basic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -124,23 +124,23 @@ basic_engine_shape (PangoEngineShape *engine, err = ATSUCreateTextLayout (&text_layout); err = ATSUSetTextPointerLocation (text_layout, utf16, 0, n16, n16); - + err = ATSUCreateStyle(&style); fontID = pango_cairo_atsui_font_get_atsu_font_id (cafont); - + err = ATSUSetAttributes(style, sizeof(styleTags) / sizeof(styleTags[0]), styleTags, styleSizes, styleValues); - + err = ATSUSetRunStyle(text_layout, style, kATSUFromTextBeginning, kATSUToTextEnd); - + err = ATSUDirectGetLayoutDataArrayPtrFromTextLayout (text_layout, 0, kATSUDirectDataLayoutRecordATSLayoutRecordCurrent, (void *)&layout_records, &glyph_count); - + p = text; pango_glyph_string_set_size (glyphs, glyph_count - 1); @@ -148,16 +148,16 @@ basic_engine_shape (PangoEngineShape *engine, { gunichar wc; gunichar mirrored_ch; - + wc = g_utf8_get_char (p); - + if (analysis->level % 2) if (pango_get_mirror_char (wc, &mirrored_ch)) wc = mirrored_ch; - + if (wc == 0xa0) /* non-break-space */ wc = 0x20; - + if (pango_is_zero_width (wc)) { set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY); @@ -165,18 +165,18 @@ basic_engine_shape (PangoEngineShape *engine, else { set_glyph (font, glyphs, i, p - text, layout_records[i].glyphID); - + if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK) { if (i > 0) { PangoRectangle logical_rect, ink_rect; - + glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width, glyphs->glyphs[i].geometry.width); glyphs->glyphs[i-1].geometry.width = 0; glyphs->log_clusters[i] = glyphs->log_clusters[i-1]; - + /* Some heuristics to try to guess how overstrike glyphs are * done and compensate */ @@ -192,7 +192,7 @@ basic_engine_shape (PangoEngineShape *engine, ATSUDirectReleaseLayoutDataArrayPtr (NULL, kATSUDirectDataLayoutRecordATSLayoutRecordCurrent, (void *)&layout_records); - + ATSUDisposeTextLayout (text_layout); } @@ -205,18 +205,18 @@ basic_engine_atsui_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineATSUI, basic_engine_atsui, basic_engine_atsui_class_init, NULL); -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { basic_engine_atsui_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index 81a90360..0dcdbbd2 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -30,7 +30,7 @@ #include "pango-ot.h" #include "basic-common.h" - + /* No extra fields needed */ typedef PangoEngineShape BasicEngineFc; typedef PangoEngineShapeClass BasicEngineFcClass; @@ -70,7 +70,7 @@ static PangoEngineScriptInfo basic_scripts[] = { /* Unicode-4.1 additions */ { PANGO_SCRIPT_GLAGOLITIC, "*" }, - + /* Unicode-5.0 additions */ { PANGO_SCRIPT_CUNEIFORM, "*" }, { PANGO_SCRIPT_PHOENICIAN, "*" }, @@ -93,16 +93,16 @@ swap_range (PangoGlyphString *glyphs, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -119,7 +119,7 @@ set_glyph (PangoFont *font, PangoRectangle logical_rect; glyphs->glyphs[i].glyph = glyph; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; @@ -129,7 +129,7 @@ set_glyph (PangoFont *font, glyphs->glyphs[i].geometry.width = logical_rect.width; } -static void +static void fallback_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -141,10 +141,10 @@ fallback_shape (PangoEngineShape *engine, glong n_chars = g_utf8_strlen (text, length); const char *p; int i; - + pango_glyph_string_set_size (glyphs, n_chars); p = text; - + for (i=0; i < n_chars; i++) { gunichar wc; @@ -158,7 +158,7 @@ fallback_shape (PangoEngineShape *engine, if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); } @@ -181,18 +181,18 @@ fallback_shape (PangoEngineShape *engine, else { set_glyph (font, glyphs, i, p - text, index); - + if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK) { if (i > 0) { PangoRectangle logical_rect, ink_rect; - + glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width, glyphs->glyphs[i].geometry.width); glyphs->glyphs[i-1].geometry.width = 0; glyphs->log_clusters[i] = glyphs->log_clusters[i-1]; - + /* Some heuristics to try to guess how overstrike glyphs are * done and compensate */ @@ -203,7 +203,7 @@ fallback_shape (PangoEngineShape *engine, } } } - + p = g_utf8_next_char (p); } @@ -269,7 +269,7 @@ get_ruleset (FT_Face face) if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GPOS, script_tag, &script_index)) for (j = 0; j < G_N_ELEMENTS (gpos_features); j++) { - PangoOTTag feature_tag = FT_MAKE_TAG (gpos_features[j][0], gpos_features[j][1], + PangoOTTag feature_tag = FT_MAKE_TAG (gpos_features[j][0], gpos_features[j][1], gpos_features[j][2], gpos_features[j][3]); guint feature_index; @@ -283,18 +283,18 @@ get_ruleset (FT_Face face) if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GSUB, script_tag, &script_index)) for (j = 0; j < G_N_ELEMENTS (gsub_features); j++) { - PangoOTTag feature_tag = FT_MAKE_TAG (gsub_features[j][0], gsub_features[j][1], + PangoOTTag feature_tag = FT_MAKE_TAG (gsub_features[j][0], gsub_features[j][1], gsub_features[j][2], gsub_features[j][3]); guint feature_index; /* 0xffff means default language */ - if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, feature_tag, + if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, feature_tag, script_index, 0xffff, &feature_index)) { pango_ot_ruleset_add_feature (ruleset, PANGO_OT_TABLE_GSUB, feature_index, 0xffff); } } - } + } g_object_set_qdata_full (G_OBJECT (info), ruleset_quark, ruleset, (GDestroyNotify) g_object_unref); } @@ -303,7 +303,7 @@ get_ruleset (FT_Face face) } -static void +static void basic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -366,7 +366,7 @@ basic_engine_shape (PangoEngineShape *engine, if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); } @@ -377,7 +377,7 @@ basic_engine_shape (PangoEngineShape *engine, else { index = pango_fc_font_get_glyph (fc_font, wc); - + if (!index) { pango_ot_buffer_add_glyph (buffer, PANGO_GET_UNKNOWN_GLYPH ( wc), @@ -387,12 +387,12 @@ basic_engine_shape (PangoEngineShape *engine, { if (g_unichar_type (wc) != G_UNICODE_NON_SPACING_MARK) cluster = p - text; - + pango_ot_buffer_add_glyph (buffer, index, unknown_property, cluster); } } - + p = g_utf8_next_char (p); } @@ -400,7 +400,7 @@ basic_engine_shape (PangoEngineShape *engine, pango_ot_ruleset_substitute (ruleset, buffer); pango_ot_ruleset_position (ruleset, buffer); pango_ot_buffer_output (buffer, glyphs); - + pango_ot_buffer_destroy (buffer); out: @@ -416,18 +416,18 @@ basic_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineFc, basic_engine_fc, basic_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { basic_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index 16cb6bed..c0729840 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -177,7 +177,7 @@ static PangoEngineInfo script_engines[] = { } }; -static PangoGlyph +static PangoGlyph find_char (PangoFont *font, gunichar wc) { @@ -194,7 +194,7 @@ set_glyph (PangoFont *font, PangoRectangle logical_rect; glyphs->glyphs[i].glyph = glyph; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; @@ -210,16 +210,16 @@ swap_range (PangoGlyphString *glyphs, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -270,7 +270,7 @@ static char * lang_name (int lang) { static char unk[10]; - + switch (PRIMARYLANGID (lang)) { #define CASE(n) case LANG_##n: return #n @@ -699,7 +699,7 @@ convert_log_clusters_to_byte_offsets (const char *text, g_assert (glyphs->log_clusters[glyphix] < n_chars); glyphs->log_clusters[glyphix] = byte_offset[glyphs->log_clusters[glyphix]]; } - + g_free (byte_offset); } @@ -725,7 +725,7 @@ itemize_shape_and_place (PangoFont *font, control.uDefaultLanguage = make_langid (analysis->language); state.uBidiLevel = analysis->level; - + #ifdef BASIC_WIN32_DEBUGGING if (pango_win32_debug) g_print (G_STRLOC ": ScriptItemize: uDefaultLanguage:%04x uBidiLevel:%d\n", @@ -772,7 +772,7 @@ itemize_shape_and_place (PangoFont *font, memset (advances, 0, sizeof (advances)); memset (offsets, 0, sizeof (offsets)); memset (&abc, 0, sizeof (abc)); - + /* Note that itemlen is number of wchar_t's i.e. surrogate pairs * count as two! */ @@ -810,7 +810,7 @@ itemize_shape_and_place (PangoFont *font, #endif return FALSE; } - + #ifdef BASIC_WIN32_DEBUGGING dump_glyphs_and_log_clusters (items[item].a.fRTL, itemlen, items[item].iCharPos, log_clusters, @@ -819,7 +819,7 @@ itemize_shape_and_place (PangoFont *font, ng = glyphs->num_glyphs; pango_glyph_string_set_size (glyphs, ng + nglyphs); - + set_up_pango_log_clusters (wtext, items[item].a.fRTL, itemlen, log_clusters, nglyphs, glyphs->log_clusters + ng, @@ -904,7 +904,7 @@ uniscribe_shape (PangoFont *font, if (script_cache[i]) (*script_free_cache)(&script_cache[i]); } - + if (retval) { convert_log_clusters_to_byte_offsets (text, length, glyphs); @@ -952,10 +952,10 @@ text_is_simple (const char *text, return retval; } - + #endif /* HAVE_USP10_H */ -static void +static void basic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -1000,7 +1000,7 @@ basic_engine_shape (PangoEngineShape *engine, if (wc == 0xa0) /* non-break-space */ wc = 0x20; - + if (pango_is_zero_width (wc)) { set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY); @@ -1011,13 +1011,13 @@ basic_engine_shape (PangoEngineShape *engine, if (index) { set_glyph (font, glyphs, i, p - text, index); - + if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK) { if (i > 0) { PangoRectangle logical_rect, ink_rect; - + glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width, glyphs->glyphs[i].geometry.width); glyphs->glyphs[i-1].geometry.width = 0; @@ -1036,7 +1036,7 @@ basic_engine_shape (PangoEngineShape *engine, else set_glyph (font, glyphs, i, p - text, PANGO_GET_UNKNOWN_GLYPH (wc)); } - + p = g_utf8_next_char (p); } @@ -1048,7 +1048,7 @@ basic_engine_shape (PangoEngineShape *engine, /* Swap all glyphs */ swap_range (glyphs, 0, n_chars); - + /* Now reorder glyphs within each cluster back to LTR */ for (start = 0; start < n_chars;) { @@ -1056,7 +1056,7 @@ basic_engine_shape (PangoEngineShape *engine, while (end < n_chars && glyphs->log_clusters[end] == glyphs->log_clusters[start]) end++; - + swap_range (glyphs, start, end); start = end; } @@ -1070,7 +1070,7 @@ init_uniscribe (void) HMODULE usp10_dll; have_uniscribe = FALSE; - + if ((usp10_dll = LoadLibrary ("usp10.dll")) != NULL) { (script_get_properties = (pScriptGetProperties) @@ -1095,7 +1095,7 @@ init_uniscribe (void) hdc = pango_win32_get_dc (); } #endif -} +} static void basic_engine_win32_class_init (PangoEngineShapeClass *class) @@ -1106,7 +1106,7 @@ basic_engine_win32_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineWin32, basic_engine_win32, basic_engine_win32_class_init, NULL); -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { init_uniscribe (); @@ -1117,12 +1117,12 @@ PANGO_MODULE_ENTRY(init) (GTypeModule *module) basic_engine_win32_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c index 70455a64..31784f97 100644 --- a/modules/basic/basic-x.c +++ b/modules/basic/basic-x.c @@ -70,7 +70,7 @@ struct _CharRange guint16 charsets; }; -struct _MaskTable +struct _MaskTable { int n_subfonts; @@ -78,7 +78,7 @@ struct _MaskTable Charset **charsets; }; -struct _CharCache +struct _CharCache { guint ref_count; CharsetOrdering *ordering; @@ -139,15 +139,15 @@ static PangoEngineInfo script_engines[] = { * PangoFont => CharCachePointer ===\ * | \ * CharCachePointer ======> CharCache => CharsetOrdering - * | |======> MaskTable[0] => {subfonts,charset}[n_subfonts], - * | |======> MaskTable[1] => {subfonts,charset}[n_subfonts], + * | |======> MaskTable[0] => {subfonts,charset}[n_subfonts], + * | |======> MaskTable[1] => {subfonts,charset}[n_subfonts], * | \======> MaskTable[...] => {subfonts,charset}[n_subfonts] * | * CharCachePointer ======> CharCache => CharsetOrdering - * |======> MaskTable[0] => {subfonts,charset}[n_subfonts], - * |======> MaskTable[1] => {subfonts,charset}[n_subfonts], + * |======> MaskTable[0] => {subfonts,charset}[n_subfonts], + * |======> MaskTable[1] => {subfonts,charset}[n_subfonts], * \======> MaskTable[...] => {subfonts,charset}[n_subfonts] - * + * * A CharCache structure caches the lookup of what subfonts can be used for what characters for a pair of a Font * and CharsetOrdering. Multiple language tags can share the same CharsetOrdering - the list of CharCachePointer * structures that is attached to the font as object data provides lookups from language tag to charcache. @@ -164,7 +164,7 @@ char_cache_new (CharsetOrdering *ordering) result->ordering = ordering; for (i=0; i<MAX_CHARSETS; i++) result->converters[i] = (GIConv)-1; - + return result; } @@ -178,18 +178,18 @@ char_cache_free (CharCache *cache) { g_free (cache->mask_tables[i]->subfonts); g_free (cache->mask_tables[i]->charsets); - + g_free (cache->mask_tables[i]); } for (i=0; i<MAX_CHARSETS; i++) if (cache->converters[i] != (GIConv)-1) g_iconv_close (cache->converters[i]); - + g_free (cache); } -static PangoGlyph +static PangoGlyph find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input) { int mask_index; @@ -205,7 +205,7 @@ find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input) return PANGO_GET_UNKNOWN_GLYPH (wc); break; } - + if (wc >= G_N_ELEMENTS (char_masks)) mask_index = 0; else @@ -231,16 +231,16 @@ find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input) for (i=0; i<(int)G_N_ELEMENTS(charsets); i++) { int charset_index = cache->ordering->charsets[i]; - + if (mask & (1 << charset_index)) { charset_names[n_charsets] = charsets[charset_index].x_charset; charsets_map[n_charsets] = &charsets[charset_index]; - + n_charsets++; } } - + mask_table->n_subfonts = pango_x_list_subfonts (font, (char**)charset_names, n_charsets, &mask_table->subfonts, &subfont_charsets); mask_table->charsets = g_new (Charset *, mask_table->n_subfonts); @@ -272,15 +272,15 @@ find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input) mask_table->charsets[i] = NULL; continue; } - - cache->converters[charset->index] = cd; + + cache->converters[charset->index] = cd; } - + index = (*charset->conv_func) (cache, cd, input); glyph = PANGO_X_MAKE_GLYPH (mask_table->subfonts[i], index); if (pango_x_has_glyph (font, glyph)) - return glyph; + return glyph; } } @@ -293,7 +293,7 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl PangoRectangle logical_rect; glyphs->glyphs[i].glyph = glyph; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; @@ -309,14 +309,14 @@ conv_8bit (CharCache *cache, const char *input) { char outbuf; - + const char *inptr = input; size_t inbytesleft; char *outptr = &outbuf; size_t outbytesleft = 1; inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); return (guchar)outbuf; @@ -335,7 +335,7 @@ conv_eucjp (CharCache *cache, size_t outbytesleft = 4; inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); if ((guchar)outbuf[0] < 128) @@ -361,7 +361,7 @@ conv_16bit (CharCache *cache, size_t outbytesleft = 2; inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); if ((guchar)outbuf[0] < 128) @@ -383,7 +383,7 @@ conv_16bit_MSB_on (CharCache *cache, size_t outbytesleft = 2; inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); if ((guchar)outbuf[0] < 128) @@ -406,7 +406,7 @@ conv_gb18030_1 (CharCache *cache, inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); if ((guchar)outbuf[0] < 128) @@ -428,7 +428,7 @@ conv_euctw (CharCache *cache, size_t outbytesleft = 4; inbytesleft = g_utf8_next_char (input) - input; - + g_iconv (cd, (char **)&inptr, &inbytesleft, &outptr, &outbytesleft); /* The first two bytes determine which page of CNS to use; we @@ -452,16 +452,16 @@ static void swap_range (PangoGlyphString *glyphs, int start, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -475,12 +475,12 @@ char_caches_free (GSList *caches) while (tmp_list) { CharCachePointer *pointer = tmp_list->data; - + pointer->cache->ref_count--; if (pointer->cache->ref_count == 0) char_cache_free (pointer->cache); g_free (pointer); - + tmp_list = tmp_list->next; } g_slist_free (caches); @@ -496,7 +496,7 @@ ordering_for_lang (PangoLanguage *lang) if (pango_language_matches (lang, charset_orderings[i].langs)) return &charset_orderings[i]; } - + return &charset_orderings[i]; } @@ -547,15 +547,15 @@ get_char_cache (PangoFont *font, pointer->cache = cache; caches = g_slist_prepend (caches, pointer); - + g_object_steal_qdata (G_OBJECT (font), cache_id); - g_object_set_qdata_full (G_OBJECT (font), cache_id, + g_object_set_qdata_full (G_OBJECT (font), cache_id, caches, (GDestroyNotify)char_caches_free); return cache; } -static void +static void basic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -589,13 +589,13 @@ basic_engine_shape (PangoEngineShape *engine, const char *input; wc = g_utf8_get_char (p); - + input = p; if (analysis->level % 2) if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); input = buf; } @@ -603,11 +603,11 @@ basic_engine_shape (PangoEngineShape *engine, if (wc == 0xa0) /* non-break-space */ { wc = 0x20; - + g_unichar_to_utf8 (wc, buf); input = buf; } - + if (pango_is_zero_width (wc)) { set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY); @@ -618,13 +618,13 @@ basic_engine_shape (PangoEngineShape *engine, if (index) { set_glyph (font, glyphs, i, p - text, index); - + if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK) { if (i > 0) { PangoRectangle logical_rect, ink_rect; - + glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width, glyphs->glyphs[i].geometry.width); glyphs->glyphs[i-1].geometry.width = 0; @@ -642,7 +642,7 @@ basic_engine_shape (PangoEngineShape *engine, else set_glyph (font, glyphs, i, p - text, PANGO_GET_UNKNOWN_GLYPH (wc)); } - + p = g_utf8_next_char (p); } @@ -654,7 +654,7 @@ basic_engine_shape (PangoEngineShape *engine, /* Swap all glyphs */ swap_range (glyphs, 0, n_chars); - + /* Now reorder glyphs within each cluster back to LTR */ for (start=0; start<n_chars;) { @@ -662,7 +662,7 @@ basic_engine_shape (PangoEngineShape *engine, while (end < n_chars && glyphs->log_clusters[end] == glyphs->log_clusters[start]) end++; - + swap_range (glyphs, start, end); start = end; } @@ -693,18 +693,18 @@ basic_engine_x_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineX, basic_engine_x, basic_engine_x_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { basic_engine_x_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 4b218bdb..03f3b304 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -67,10 +67,10 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl /* Add a Hangul tone mark glyph in a glyph string. * Non-spacing glyph works pretty much automatically. * Spacing-glyph takes some care: - * 1. Make a room for a tone mark at the beginning(leftmost end) of a cluster + * 1. Make a room for a tone mark at the beginning(leftmost end) of a cluster * to attach it to. * 2. Adjust x_offset so that it is drawn to the left of a cluster. - * 3. Set the logical width to zero. + * 3. Set the logical width to zero. */ static void @@ -84,33 +84,33 @@ set_glyph_tone (PangoFont *font, PangoGlyphString *glyphs, int i, glyphs->glyphs[i].geometry.y_offset = 0; glyphs->log_clusters[i] = offset; - pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect); - /* tone mark is not the first in a glyph string. We have info. on the - * preceding glyphs in a glyph string + /* tone mark is not the first in a glyph string. We have info. on the + * preceding glyphs in a glyph string */ { int j = i - 1; /* search for the beg. of the preceding cluster */ - while (j >= 0 && glyphs->log_clusters[j] == glyphs->log_clusters[i - 1]) + while (j >= 0 && glyphs->log_clusters[j] == glyphs->log_clusters[i - 1]) j--; - /* In .._extents_range(...,start,end,...), to my surprise start is - * inclusive but end is exclusive !! + /* In .._extents_range(...,start,end,...), to my surprise start is + * inclusive but end is exclusive !! */ - pango_glyph_string_extents_range (glyphs, j + 1, i, font, - NULL, &logical_rect_cluster); + pango_glyph_string_extents_range (glyphs, j + 1, i, font, + NULL, &logical_rect_cluster); /* logical_rect_cluster.width is all the offset we need so that the * inherent x_offset in the glyph (ink_rect.x) should be canceled out. */ glyphs->glyphs[i].geometry.x_offset = - logical_rect_cluster.width - - ink_rect.x ; - + - ink_rect.x ; + /* make an additional room for a tone mark if it has a spacing glyph - * because that's likely to be an indication that glyphs for other + * because that's likely to be an indication that glyphs for other * characters in the font are not designed for combining with tone marks. */ if (logical_rect.width) @@ -140,7 +140,7 @@ render_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs, { set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index); } - else + else { /* fall back : HTONE1(0x302e) => middle-dot, HTONE2(0x302f) => colon */ index = find_char (font, tone == HTONE1 ? 0x00b7 : 0x003a); @@ -148,7 +148,7 @@ render_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs, { set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index); } - else + else set_glyph (font, glyphs, *n_glyphs, cluster_offset, PANGO_GET_UNKNOWN_GLYPH (tone)); } @@ -201,7 +201,7 @@ render_syllable (PangoFont *font, const char *str, int length, * I have seen no smart font which can render S+T as a syllable * form. */ - + if (length == 3 || length == 4) { p = str; @@ -213,7 +213,7 @@ render_syllable (PangoFont *font, const char *str, int length, if (length == 4 && !IS_M(g_utf8_get_char(g_utf8_next_char(p)))) goto lvt_out; /* draw the tone mark later */ - + if (IS_L_S(text[0]) && IS_V_S(text[1]) && IS_T_S(text[2])) { composed = 3; @@ -395,7 +395,7 @@ render_basic (PangoFont *font, gunichar wc, (*n_glyphs)++; } -static void +static void hangul_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -469,18 +469,18 @@ hangul_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (HangulEngineFc, hangul_engine_fc, hangul_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { hangul_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c index da776d5d..d26cb52e 100644 --- a/modules/hebrew/hebrew-fc.c +++ b/modules/hebrew/hebrew-fc.c @@ -69,7 +69,7 @@ get_cluster_glyphs(PangoFont *font, PangoRectangle logical_rect; gunichar wc = cluster[i]; gunichar mirrored_ch; - + if (do_mirror) if (pango_get_mirror_char (wc, &mirrored_ch)) wc = mirrored_ch; @@ -88,7 +88,7 @@ get_cluster_glyphs(PangoFont *font, pango_font_get_glyph_extents (font, glyph[i], &ink_rects[i], &logical_rect); - + /* Assign the base char width to the last character in the cluster */ if (i==0) { @@ -101,8 +101,8 @@ get_cluster_glyphs(PangoFont *font, } static void -add_glyph (PangoGlyphString *glyphs, - gint cluster_start, +add_glyph (PangoGlyphString *glyphs, + gint cluster_start, PangoGlyph glyph, gboolean is_combining, gint width, @@ -113,10 +113,10 @@ add_glyph (PangoGlyphString *glyphs, gint index = glyphs->num_glyphs; pango_glyph_string_set_size (glyphs, index + 1); - + glyphs->glyphs[index].glyph = glyph; glyphs->glyphs[index].attr.is_cluster_start = is_combining ? 0 : 1; - + glyphs->log_clusters[index] = cluster_start; glyphs->glyphs[index].geometry.x_offset = x_offset; @@ -152,7 +152,7 @@ maybe_add_gsub_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, tag, script_index, 0xffff, &feature_index)) @@ -168,7 +168,7 @@ maybe_add_gpos_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GPOS, tag, script_index, 0xffff, &feature_index)) @@ -188,7 +188,7 @@ get_ruleset (FT_Face face) if (!ruleset_quark) ruleset_quark = g_quark_from_string ("pango-hebrew-ruleset"); - + if (!info) return NULL; @@ -231,7 +231,7 @@ get_ruleset (FT_Face face) return ruleset; } -static void +static void fallback_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -266,7 +266,7 @@ fallback_shape (PangoEngineShape *engine, glyph, glyph_width, ink_rects); - + /* Kern the glyphs! */ hebrew_shaper_get_cluster_kerning(cluster, cluster_size, @@ -276,7 +276,7 @@ fallback_shape (PangoEngineShape *engine, /* output */ x_offset, y_offset); - + add_cluster(font, glyphs, cluster_size, @@ -286,14 +286,14 @@ fallback_shape (PangoEngineShape *engine, glyph_width, x_offset, y_offset); - + } if (analysis->level % 2) hebrew_shaper_bidi_reorder(glyphs); } -static void +static void hebrew_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -330,9 +330,9 @@ hebrew_engine_shape (PangoEngineShape *engine, buffer = pango_ot_buffer_new (fc_font); pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); - + n_chars = g_utf8_strlen (text, length); - + p = text; for (i=0; i < n_chars; i++) { @@ -346,7 +346,7 @@ hebrew_engine_shape (PangoEngineShape *engine, if (pango_get_mirror_char (wc, &mirrored_ch)) { wc = mirrored_ch; - + g_unichar_to_utf8 (wc, buf); } @@ -357,7 +357,7 @@ hebrew_engine_shape (PangoEngineShape *engine, else { index = pango_fc_font_get_glyph (fc_font, wc); - + if (!index) { pango_ot_buffer_add_glyph (buffer, PANGO_GET_UNKNOWN_GLYPH ( wc), @@ -366,22 +366,22 @@ hebrew_engine_shape (PangoEngineShape *engine, else { cluster = p - text; - + pango_ot_buffer_add_glyph (buffer, index, unknown_property, cluster); } } - + p = g_utf8_next_char (p); } - + pango_ot_ruleset_substitute (ruleset, buffer); pango_ot_ruleset_position (ruleset, buffer); pango_ot_buffer_output (buffer, glyphs); pango_ot_buffer_destroy (buffer); - + out: pango_fc_font_unlock_face (fc_font); } @@ -395,18 +395,18 @@ hebrew_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (HebrewEngineFc, hebrew_engine_fc, hebrew_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { hebrew_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/hebrew/hebrew-shaper.c b/modules/hebrew/hebrew-shaper.c index 276ac108..ae77f688 100644 --- a/modules/hebrew/hebrew-shaper.c +++ b/modules/hebrew/hebrew-shaper.c @@ -6,7 +6,7 @@ * * Hebrew points positioning improvements 2001 * Author: Dov Grobgeld <dov@imagic.weizmann.ac.il> - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either @@ -99,7 +99,7 @@ static const gint char_class_table[128] = { /*00*/ _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, _ND, - + /*10*/ _ND, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, _NS, /*20*/ _NS, _NS, _ND, _NS, _NS, _NS, _NS, _NS, @@ -121,7 +121,7 @@ static const gint char_type_table[128] = { /*00*/ __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, __ND, - + /*10*/ __ND, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, __NS, /*20*/ __NS, __NS, __ND, __NS, __NS, __NS, __NS, __NS, @@ -172,21 +172,21 @@ hebrew_shaper_get_next_cluster(const char *text, gint length, gunichar *cluster, gint *num_chrs) -{ +{ const char *p; gint n_chars = 0; - + p = text; - while (p < text + length && n_chars < MAX_CLUSTER_CHRS) + while (p < text + length && n_chars < MAX_CLUSTER_CHRS) { gunichar current = g_utf8_get_char (p); - + if (!ishebrew (current) || (n_chars == 0 && is_char_class(current, ~(NoDefine|SpacingLetter)))) { /* Not a legal Hebrew cluster */ - + if (n_chars == 0) { cluster[n_chars++] = current; @@ -235,7 +235,7 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, x_offset[0] = -ink_rect[0].x - ink_rect[0].width; width[0] = 0; } - + return; } @@ -250,14 +250,14 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, int gl = cluster[i]; x_offset[i] = 0; y_offset[i] = 0; - + /* Check if it is a point */ if (gl < 0x5B0 || gl >= 0x05D0) continue; - + /* Center dot of VAV */ if (gl == UNI_MAPIQ && base_char == UNI_VAV) - { + { x_offset[i] = base_ink_x_offset - ink_rect[i].x; /* If VAV is a vertical bar without a roof, then we @@ -286,14 +286,14 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, /* Dot over SHIN */ else if (gl == UNI_SHIN_DOT && base_char == UNI_SHIN) - { + { x_offset[i] = base_ink_x_offset + base_ink_width - ink_rect[i].x - ink_rect[i].width; } - + /* Dot over SIN */ else if (gl == UNI_SIN_DOT && base_char == UNI_SHIN) - { + { x_offset[i] = base_ink_x_offset - ink_rect[i].x; } @@ -301,10 +301,10 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, SHIN or VAV should stick out a bit to the left. */ else if ((gl == UNI_SIN_DOT || gl == UNI_HOLAM) && base_char != UNI_SHIN && base_char != UNI_VAV) - { + { x_offset[i] = base_ink_x_offset -ink_rect[i].x - ink_rect[i].width * 3/ 2; } - + /* VOWELS under resh or vav are right aligned, if they are narrower than the characters. Otherwise they are centered. */ @@ -316,7 +316,7 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, && ((gl >= UNI_SHEVA && gl <= UNI_QAMATS) || gl == UNI_QUBUTS) && ink_rect[i].width < base_ink_width - ) + ) { x_offset[i] = base_ink_x_offset + base_ink_width - ink_rect[i].x - ink_rect[i].width; @@ -327,7 +327,7 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, else if ((base_char == UNI_FINAL_KAF ) && ((gl >= UNI_SHEVA && gl <= UNI_QAMATS) || - gl == UNI_QUBUTS)) + gl == UNI_QUBUTS)) { /* x are at 1/3 to take into accoun the stem */ x_offset[i] = base_ink_x_offset - ink_rect[i].x @@ -338,14 +338,14 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, + base_ink_height * 1/2 - ink_rect[i].height/2; } - + /* MAPIQ in PE or FINAL PE */ else if (gl == UNI_MAPIQ && (base_char == UNI_PE || base_char == UNI_FINAL_PE)) { x_offset[i]= base_ink_x_offset - ink_rect[i].x + base_ink_width * 2/3 - ink_rect[i].width/2; - + /* Another option is to offset the MAPIQ in y... glyphs->glyphs[cluster_start_idx+i].geometry.y_offset -= base_ink_height/5; */ @@ -364,7 +364,7 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, && base_char == UNI_YOD) { x_offset[i]= base_ink_x_offset - ink_rect[i].x; - + /* Lower left in y */ y_offset[i] = base_ink_y_offset - ink_rect[i].y + base_ink_height - ink_rect[i].height*1.75; @@ -381,13 +381,13 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, width[cluster_length-1] += ink_rect[i].width*(1+space-kern); } - + } /* VOWEL DOT next to any other character */ else if ((gl == UNI_SIN_DOT || gl == UNI_HOLAM) && (base_char != UNI_VAV)) - { + { x_offset[i] = base_ink_x_offset -ink_rect[i].x; } @@ -425,12 +425,12 @@ hebrew_shaper_get_cluster_kerning(gunichar *cluster, /* Center by default */ else - { + { x_offset[i] = base_ink_x_offset - ink_rect[i].x + base_ink_width/2 - ink_rect[i].width/2; } } - + } void @@ -439,16 +439,16 @@ hebrew_shaper_swap_range (PangoGlyphString *glyphs, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -459,10 +459,10 @@ void hebrew_shaper_bidi_reorder(PangoGlyphString *glyphs) { int start, end; - + /* Swap all glyphs */ hebrew_shaper_swap_range (glyphs, 0, glyphs->num_glyphs); - + /* Now reorder glyphs within each cluster back to LTR */ for (start = 0; start < glyphs->num_glyphs;) { @@ -470,7 +470,7 @@ hebrew_shaper_bidi_reorder(PangoGlyphString *glyphs) while (end < glyphs->num_glyphs && glyphs->log_clusters[end] == glyphs->log_clusters[start]) end++; - + hebrew_shaper_swap_range (glyphs, start, end); start = end; } diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index daa2c23e..cdfa7696 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -45,7 +45,7 @@ struct _IndicEngineFc struct _PangoIndicInfo { - PangoOTTag scriptTag; + PangoOTTag scriptTag; const IndicOTClassTable *classTable; const gchar *gsubQuarkName; const gchar *gposQuarkName; @@ -139,7 +139,7 @@ maybe_add_GSUB_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, feature_tag, script_index, 0xffff, &feature_index)) @@ -316,7 +316,7 @@ expand_text(const gchar *text, glong length, glong **offsets, glong *n_chars) /* analysis->shape_engine has the PangoEngine... */ -static void +static void indic_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -352,15 +352,15 @@ indic_engine_shape (PangoEngineShape *engine, 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, 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, &mprefixups); - + pango_glyph_string_set_size (glyphs, n_glyphs); buffer = pango_ot_buffer_new (fc_font); @@ -409,18 +409,18 @@ indic_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (IndicEngineFc, indic_engine_fc, indic_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { indic_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { @@ -439,7 +439,7 @@ PANGO_MODULE_ENTRY(create) (const char *id) { IndicEngineFc *engine = g_object_new (indic_engine_fc_type, NULL); engine->indicInfo = &indic_info[i]; - + return (PangoEngine *)engine; } } diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c index 3c9a21e4..89ab301f 100644 --- a/modules/indic/indic-lang.c +++ b/modules/indic/indic-lang.c @@ -154,7 +154,7 @@ indic_engine_break (PangoEngineLang *engine, 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) @@ -169,7 +169,7 @@ indic_engine_break (PangoEngineLang *engine, attrs[i].is_cursor_position = FALSE; attrs[i].is_char_break = FALSE; attrs[i].is_line_break = FALSE; - attrs[i].is_mandatory_break = FALSE; + attrs[i].is_mandatory_break = FALSE; } else if ((next_next_wc != 0) && (next_wc == 0x09CD || /* Bengali */ @@ -193,19 +193,19 @@ indic_engine_break (PangoEngineLang *engine, attrs[i].is_cursor_position = FALSE; attrs[i].is_char_break = FALSE; attrs[i].is_line_break = FALSE; - attrs[i].is_mandatory_break = FALSE; + attrs[i].is_mandatory_break = FALSE; - i++; + i++; attrs[i].is_cursor_position = FALSE; - } + } } - else + 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; - } + } } } } diff --git a/modules/indic/indic-ot-class-tables.c b/modules/indic/indic-ot-class-tables.c index 52966c8f..fe664bc9 100644 --- a/modules/indic/indic-ot-class-tables.c +++ b/modules/indic/indic-ot-class-tables.c @@ -151,7 +151,7 @@ static const IndicOTCharClass gujrCharClasses[] = }; static const IndicOTCharClass oryaCharClasses[] = -{ +{ _xx, _ma, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _iv, /* 0B00 - 0B0F */ _iv, _xx, _xx, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _ct, _bb, /* 0B10 - 0B1F */ _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _pb, /* 0B20 - 0B2F */ @@ -468,44 +468,44 @@ glong indic_ot_find_syllable(const IndicOTClassTable *class_table, const gunicha state = stateTable[state][char_class & CF_CLASS_MASK]; - /*for the components of split matra*/ + /*for the components of split matra*/ if ((char_count >= cursor + 3) && (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DCF && chars[cursor + 2] == 0x0DCA)) { /*for 3 split matra of Sinhala*/ return cursor + 3; - } + } else if ((char_count >= cursor + 3) && (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CC2 && chars[cursor + 2] == 0x0CD5)) { /*for 3 split matra of Kannada*/ return cursor + 3; } - /*for 2 split matra*/ + /*for 2 split matra*/ else if (char_count >= cursor + 2) { /*for Bengali*/ - if ((chars[cursor] == 0x09C7 && chars[cursor + 1] == 0x09BE) || - (chars[cursor] == 0x09C7 && chars[cursor + 1] == 0x09D7) || + if ((chars[cursor] == 0x09C7 && chars[cursor + 1] == 0x09BE) || + (chars[cursor] == 0x09C7 && chars[cursor + 1] == 0x09D7) || /*for Oriya*/ - (chars[cursor] == 0x0B47 && chars[cursor + 1] == 0x0B3E) || - (chars[cursor] == 0x0B47 && chars[cursor + 1] == 0x0B56) || + (chars[cursor] == 0x0B47 && chars[cursor + 1] == 0x0B3E) || + (chars[cursor] == 0x0B47 && chars[cursor + 1] == 0x0B56) || (chars[cursor] == 0x0B47 && chars[cursor + 1] == 0x0B57) || /*for Tamil*/ - (chars[cursor] == 0x0BC6 && chars[cursor + 1] == 0x0BBE) || - (chars[cursor] == 0x0BC6 && chars[cursor + 1] == 0x0BD7) || - (chars[cursor] == 0x0BC7 && chars[cursor + 1] == 0x0BBE) || + (chars[cursor] == 0x0BC6 && chars[cursor + 1] == 0x0BBE) || + (chars[cursor] == 0x0BC6 && chars[cursor + 1] == 0x0BD7) || + (chars[cursor] == 0x0BC7 && chars[cursor + 1] == 0x0BBE) || /*for Malayalam*/ - (chars[cursor] == 0x0D46 && chars[cursor + 1] == 0x0D3E) || - (chars[cursor] == 0x0D46 && chars[cursor + 1] == 0x0D57) || - (chars[cursor] == 0x0D47 && chars[cursor + 1] == 0x0D3E) || + (chars[cursor] == 0x0D46 && chars[cursor + 1] == 0x0D3E) || + (chars[cursor] == 0x0D46 && chars[cursor + 1] == 0x0D57) || + (chars[cursor] == 0x0D47 && chars[cursor + 1] == 0x0D3E) || /*for Sinhala*/ - (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DCA) || - (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DCF) || - (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DDF) || - (chars[cursor] == 0x0DDC && chars[cursor + 1] == 0x0DCA) || + (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DCA) || + (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DCF) || + (chars[cursor] == 0x0DD9 && chars[cursor + 1] == 0x0DDF) || + (chars[cursor] == 0x0DDC && chars[cursor + 1] == 0x0DCA) || /*for Telugu*/ - (chars[cursor] == 0x0C46 && chars[cursor + 1] == 0x0C56) || + (chars[cursor] == 0x0C46 && chars[cursor + 1] == 0x0C56) || /*for Kannada*/ - (chars[cursor] == 0x0CBF && chars[cursor + 1] == 0x0CD5) || - (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CD5) || - (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CD6) || - (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CC2) || + (chars[cursor] == 0x0CBF && chars[cursor + 1] == 0x0CD5) || + (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CD5) || + (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CD6) || + (chars[cursor] == 0x0CC6 && chars[cursor + 1] == 0x0CC2) || (chars[cursor] == 0x0CCA && chars[cursor + 1] == 0x0CD5)) return cursor + 2; } diff --git a/modules/indic/indic-ot.c b/modules/indic/indic-ot.c index 47df96a4..3b392674 100644 --- a/modules/indic/indic-ot.c +++ b/modules/indic/indic-ot.c @@ -130,7 +130,7 @@ static gboolean noteMatra(Output *output, const IndicOTClassTable *classTable, g } else { saveMatra(output, matra, matraClass); } - + return TRUE; } else return FALSE; @@ -156,7 +156,7 @@ static void swapChars(Output *output, int a, int b) output->fOutChars[output->fOutIndex + b] = output->fOutChars[output->fOutIndex + a]; output->fCharIndices[output->fOutIndex + b] = output->fCharIndices[output->fOutIndex + a]; - output->fCharTags[output->fOutIndex + b] = pstf_p; + output->fCharTags[output->fOutIndex + b] = pstf_p; output->fOutChars[output->fOutIndex + a] = temp_char; output->fCharIndices[output->fOutIndex + a] = temp_index; @@ -181,7 +181,7 @@ static void writeMpre(Output *output) gulong tags = output->fMatraTags; if (output->fMatraWordStart) tags &= ~init; - + output->fMPreOutIndex = output->fOutIndex; writeChar(output, output->fMpre, output->fMatraIndex, tags); } @@ -414,7 +414,7 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c /* note the base consonant for post-GSUB fixups */ noteBaseConsonant(&output); - + /* write base consonant */ for (i = baseConsonant; i < bcSpan; i += 1) { writeChar(&output, chars[i], /*i*/ prev, nukt_p); @@ -423,18 +423,18 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c /* for the special conjuction of Cons+0x0d4d+0x0d31 or Cons+0x0d4d+0x0d30 of Malayalam */ if ((baseConsonant - 2 >= 0) && (chars[baseConsonant - 1] == 0x0d4d) && - ((chars[baseConsonant] == 0x0d31) || + ((chars[baseConsonant] == 0x0d31) || (chars[baseConsonant] == 0x0d30)) && - ((chars[baseConsonant - 2] >= 0x0d15) && + ((chars[baseConsonant - 2] >= 0x0d15) && (chars[baseConsonant - 2] <= 0x0d39))) { swapChars (&output, -1, -3); - + if (mpreFixups) { if (mpreFixups->fFixupCount > 0) { mpreFixups->fFixupCount--; } - } - } + } + } if ((class_table->scriptFlags & SF_MATRAS_AFTER_BASE) != 0) { gboolean is_for_0C48 = FALSE; @@ -447,11 +447,11 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c writeMpost(&output); is_for_0C48 = TRUE; - break; + break; } } } - + if (!is_for_0C48) { writeMbelow(&output); writeMabove(&output); @@ -546,6 +546,6 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c if (outMPreFixups) { *outMPreFixups = mpreFixups; } - + return getOutputIndex(&output); } diff --git a/modules/indic/mprefixups.c b/modules/indic/mprefixups.c index 34118f5e..60517d88 100644 --- a/modules/indic/mprefixups.c +++ b/modules/indic/mprefixups.c @@ -1,5 +1,5 @@ -/* - * mprefixups.h: Handle left matra placement +/* + * mprefixups.h: Handle left matra placement * * Author: Sivaraj Doddannan * Ported from IBM's ICU engine. Original copyright: @@ -55,7 +55,7 @@ void indic_mprefixups_add (MPreFixups *mprefixups, glong baseIndex, glong mpreIn if (baseIndex - mpreIndex > 1) { mprefixups->fFixupData[mprefixups->fFixupCount].fBaseIndex = baseIndex; mprefixups->fFixupData[mprefixups->fFixupCount].fMPreIndex = mpreIndex; - + mprefixups->fFixupCount += 1; } } @@ -79,7 +79,7 @@ void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer) /* determine post GSUB location of baseIndex and mpreIndex */ pango_ot_buffer_get_glyphs (buffer, &glyphs, &n_glyphs); - + for (i = 0; i < n_glyphs; i++) { if (baseGlyph < 0 && glyphs[i].cluster == baseIndex) baseGlyph = i; @@ -87,7 +87,7 @@ void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer) if (mpreGlyph < 0) mpreGlyph = i; mpreLimit = i + 1; - } + } } if (baseGlyph < 0 || mpreGlyph < 0 || mpreLimit >= baseGlyph) { continue; @@ -110,7 +110,7 @@ void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer) for (i = 0; i < mpreCount; i += 1) { glyphs[mpreDest + i] = mpreSave[i]; } - + g_free(mpreSave); - } + } } diff --git a/modules/indic/mprefixups.h b/modules/indic/mprefixups.h index d09d6be5..22336dba 100644 --- a/modules/indic/mprefixups.h +++ b/modules/indic/mprefixups.h @@ -1,5 +1,5 @@ -/* - * mprefixups.c: Handle left matra placement +/* + * mprefixups.c: Handle left matra placement * * Author: Sivaraj Doddannan * Ported from IBM's ICU engine. Original copyright: @@ -43,7 +43,7 @@ MPreFixups *indic_mprefixups_new(glong char_count); void indic_mprefixups_free(MPreFixups *mprefixups); void indic_mprefixups_add(MPreFixups *mprefixups, glong baseIndex, glong mpreIndex); void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer); - + G_END_DECLS diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index 82874624..3a92b05d 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -643,7 +643,7 @@ khmer_engine_shape (PangoEngineShape *engine, case CF_POS_AFTER : pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), pstf_p, p - text); break; - + case CF_POS_BELOW : pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), blwf_p, p - text); break; diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c index 51260838..985f0040 100644 --- a/modules/syriac/syriac-fc.c +++ b/modules/syriac/syriac-fc.c @@ -59,7 +59,7 @@ maybe_add_gsub_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, tag, script_index, 0xffff, &feature_index)) @@ -75,7 +75,7 @@ maybe_add_gpos_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GPOS, tag, script_index, 0xffff, &feature_index)) @@ -93,7 +93,7 @@ get_ruleset (FT_Face face) if (!ruleset_quark) ruleset_quark = g_quark_from_string ("pango-syriac-ruleset"); - + if (!info) return NULL; @@ -107,7 +107,7 @@ get_ruleset (FT_Face face) ruleset = pango_ot_ruleset_new (info); #define ALL_GLYPHS ~(gulong)0 - + if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GSUB, syrc_tag, &script_index)) { @@ -144,16 +144,16 @@ static void swap_range (PangoGlyphString *glyphs, int start, int end) { int i, j; - + for (i = start, j = end - 1; i < j; i++, j--) { PangoGlyphInfo glyph_info; gint log_cluster; - + glyph_info = glyphs->glyphs[i]; glyphs->glyphs[i] = glyphs->glyphs[j]; glyphs->glyphs[j] = glyph_info; - + log_cluster = glyphs->log_clusters[i]; glyphs->log_clusters[i] = glyphs->log_clusters[j]; glyphs->log_clusters[j] = log_cluster; @@ -171,7 +171,7 @@ set_glyph (PangoFont *font, glyphs->log_clusters[i] = offset; } -static void +static void fallback_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -183,10 +183,10 @@ fallback_shape (PangoEngineShape *engine, glong n_chars = g_utf8_strlen (text, length); const char *p; int i; - + pango_glyph_string_set_size (glyphs, n_chars); p = text; - + for (i=0; i < n_chars; i++) { gunichar wc; @@ -212,7 +212,7 @@ fallback_shape (PangoEngineShape *engine, set_glyph (font, glyphs, i, p - text, index); } - + p = g_utf8_next_char (p); } @@ -222,17 +222,17 @@ fallback_shape (PangoEngineShape *engine, if (glyphs->glyphs[i].glyph) { PangoRectangle logical_rect; - + pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect); glyphs->glyphs[i].geometry.width = logical_rect.width; } else glyphs->glyphs[i].geometry.width = 0; - + glyphs->glyphs[i].geometry.x_offset = 0; glyphs->glyphs[i].geometry.y_offset = 0; } - + if (analysis->level % 2 != 0) { /* Swap all glyphs */ @@ -240,7 +240,7 @@ fallback_shape (PangoEngineShape *engine, } } -static void +static void syriac_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, @@ -279,14 +279,14 @@ syriac_engine_shape (PangoEngineShape *engine, buffer = pango_ot_buffer_new (fc_font); pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); pango_ot_buffer_set_zero_width_marks (buffer, TRUE); - + wcs = g_utf8_to_ucs4_fast (text, length, &n_chars); properties = g_new0 (gulong, n_chars); - + syriac_assign_properties (wcs, properties, n_chars); g_free (wcs); - + p = text; for (i=0; i < n_chars; i++) { @@ -317,19 +317,19 @@ syriac_engine_shape (PangoEngineShape *engine, { if (g_unichar_type (wc) != G_UNICODE_NON_SPACING_MARK) cluster = p - text; - + pango_ot_buffer_add_glyph (buffer, index, properties[i], cluster); } } - + p = g_utf8_next_char (p); } pango_ot_ruleset_substitute (ruleset, buffer); pango_ot_ruleset_position (ruleset, buffer); pango_ot_buffer_output (buffer, glyphs); - + g_free (properties); pango_ot_buffer_destroy (buffer); @@ -346,18 +346,18 @@ syriac_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (SyriacEngineFc, syriac_engine_fc, syriac_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { syriac_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/syriac/syriac-ot.c b/modules/syriac/syriac-ot.c index a2489bc0..4650c9da 100644 --- a/modules/syriac/syriac-ot.c +++ b/modules/syriac/syriac-ot.c @@ -7,7 +7,7 @@ * * This file is based on the Arabic shaping code from FreeType 1 tree; original * copyright notice: - * + * * The FreeType project -- a free and portable quality TrueType renderer. * * Copyright 1996-2000 by @@ -36,7 +36,7 @@ static const JoiningClass syriac[] = none, none, none, none, none, none, none, none, none, none, none, transparent, - + /* U+0710 */ right, none, dual, dual, dual, right, right, right, @@ -83,7 +83,7 @@ Get_Joining_Class (gunichar* string, if (pos >= length) return none; - + if (string[pos] < 0x0700 || string[pos] >= 0x074F) { @@ -91,10 +91,10 @@ Get_Joining_Class (gunichar* string, return causing; else return none; - } + } else j = syriac[string[pos] - 0x0700]; - + if (!direction || j != transparent) return j; } @@ -106,7 +106,7 @@ Get_Joining_Class (gunichar* string, * with the Syriac rules from the Unicode-4.0 standard. The numbers * R1...R11 below do not correspond to either the Arabic or the Syriac * rule numbering from the Unicode standard. - * + * * Characters are here specified as appearing in the byte stream, i.e. * *not* in visual order. Joining classes are given in angle brackets, * glyph forms in square brackets. Glyphs affected by a specific rule are @@ -115,10 +115,10 @@ Get_Joining_Class (gunichar* string, * * Glyphs: 0x0715 (Dalath), 0x0716 (Dalath Rish), 0x072A (Rish), * 0x0722 (Nun), 0x071F (Kaph) - * + * * * R1: <anything1> <transparent> <anything2> - * + * * apply joining rules for * <anything1> <anything2> -> [shape1] [shape2] * -> [shape1] [isolated] [shape2] @@ -139,25 +139,25 @@ Get_Joining_Class (gunichar* string, * * * R3: <causing|right|dual> && <!(0x0715|0x0716|0x072A)> |<alaph>| - * + * * -> [final2] * - * If the preceding glyph cannot be joined to the current - * glyph and the preceding character is not a Dalath, Rish, - * or Dotless Dalath Rish, then the Alaph takes this contextual + * If the preceding glyph cannot be joined to the current + * glyph and the preceding character is not a Dalath, Rish, + * or Dotless Dalath Rish, then the Alaph takes this contextual * position. * * The [final2] joining rule is placed ahead of the [final] to * give it greater precedence when choosing the correct glyph. * If it comes after the [final] rule, the incorrect glyph is * inserted into position. - * - * + * + * * R4: <0x0715|0x0715|0x072A> |<alaph>| * * -> [final3] * - * If the previous glyph is a Dalath, Rish, or Dotless Dalath + * If the previous glyph is a Dalath, Rish, or Dotless Dalath * Rish, then the Alaph takes this contextual position. * * The [final3] joining rule is placed ahead of the [final] to @@ -169,13 +169,13 @@ Get_Joining_Class (gunichar* string, * R5: <causing|right|dual> |<right>| * * -> [final] - * - * + * + * * R6: <causing|right|dual> |<dual>| <!(causing|right|dual)> * * -> [final] - * - * + * + * * R7: <causing|left|dual> |<dual>| <causing|right|dual> * * -> [medial] @@ -185,10 +185,10 @@ Get_Joining_Class (gunichar* string, * * -> [medial2] * - * If the Alaph glyph falls in the middle of a Syriac word and - * the preceding character cannot be joined to, then the Alaph + * If the Alaph glyph falls in the middle of a Syriac word and + * the preceding character cannot be joined to, then the Alaph * takes this contextual position. - * + * * * R9: |<left>| <causing|right|dual> * @@ -238,7 +238,7 @@ syriac_assign_properties (gunichar *string, /* R2 */ if (string[i] == 0x0722 || - string[i] == 0x071F) + string[i] == 0x071F) if (previous == causing || previous == right) if (!(next == causing || @@ -270,7 +270,7 @@ syriac_assign_properties (gunichar *string, if (string[i - 1] == 0x0715 || string[i - 1] == 0x0716 || string[i - 1] == 0x072A) - { + { properties[i] |= final3_p; continue; } @@ -280,7 +280,7 @@ syriac_assign_properties (gunichar *string, if (previous == causing || previous == right || previous == dual) - if (current == right) + if (current == right) { properties[i] |= final_p; continue; @@ -352,10 +352,10 @@ syriac_assign_properties (gunichar *string, continue; } - /* R11 */ + /* R11 */ properties[i] |= isolated_p; } - + return FT_Err_Ok; } diff --git a/modules/syriac/syriac-ot.h b/modules/syriac/syriac-ot.h index 17efd18e..e9aea543 100644 --- a/modules/syriac/syriac-ot.h +++ b/modules/syriac/syriac-ot.h @@ -7,7 +7,7 @@ * * This file is based on the Arabic shaping code from FreeType 1 tree; original * copyright notice: - * + * * The FreeType project -- a free and portable quality TrueType renderer. * * Copyright 1996-2000 by @@ -15,7 +15,7 @@ * * The code, like the FreeType code it is derived from is dual-licensed * under the GNU Public License and the FreeType license. See see - * pango/opentype/FT-license.txt for full details of the FreeType + * pango/opentype/FT-license.txt for full details of the FreeType * license. */ @@ -26,7 +26,7 @@ G_BEGIN_DECLS -typedef enum +typedef enum { isolated = 1 << 0, /* nominal */ final = 1 << 1, /* right_joining */ @@ -50,7 +50,7 @@ typedef enum final3_p = isolated | final | initial | medial | medial2 | final2 } SyriacGlyphForm; -typedef enum +typedef enum { right, left, /* not used */ diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index 4414bd93..ebb2e97a 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -63,10 +63,10 @@ static PangoEngineInfo script_engines[] = { /* TIS-to-Unicode glyph maps for characters 0x80-0xff */ static const int tis620_0[128] = { - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, 0x0020, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, @@ -120,10 +120,10 @@ static const int tis620_2[128] = { }; static const int lao_0[128] = { - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, - /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, 0x0020, 0x0e81, 0x0e82, 0, 0x0e84, 0, 0, 0x0e87, 0x0e88, 0, 0x0e8a, 0, 0, 0x0e8d, 0, 0, 0, 0, 0, 0, 0x0e94, 0x0e95, 0x0e96, 0x0e97, @@ -162,7 +162,7 @@ thai_get_font_info (PangoFont *font) { ThaiFontInfo *font_info; GQuark info_id = g_quark_from_string ("thai-font-info"); - + font_info = g_object_get_qdata (G_OBJECT (font), info_id); if (!font_info) @@ -172,7 +172,7 @@ thai_get_font_info (PangoFont *font) */ font_info = g_new (ThaiFontInfo, 1); font_info->font = font; - + /* detect font set by determining availibility of OT ruleset & glyphs */ if (thai_ot_get_ruleset (font)) font_info->font_set = THAI_FONT_TIS; @@ -182,7 +182,7 @@ thai_get_font_info (PangoFont *font) font_info->font_set = THAI_FONT_TIS_MAC; else font_info->font_set = THAI_FONT_TIS; - + g_object_set_qdata_full (G_OBJECT (font), info_id, font_info, (GDestroyNotify)g_free); } @@ -249,18 +249,18 @@ thai_engine_fc_class_init (PangoEngineShapeClass *class) PANGO_ENGINE_SHAPE_DEFINE_TYPE (ThaiEngineFc, thai_engine_fc, thai_engine_fc_class_init, NULL) -void +void PANGO_MODULE_ENTRY(init) (GTypeModule *module) { thai_engine_fc_register_type (module); } -void +void PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, int *n_engines) { diff --git a/modules/thai/thai-lang.c b/modules/thai/thai-lang.c index 37c1a2c8..a6fe45c4 100644 --- a/modules/thai/thai-lang.c +++ b/modules/thai/thai-lang.c @@ -14,7 +14,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software + * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -119,7 +119,7 @@ PANGO_MODULE_ENTRY(exit) (void) { } -void +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, gint *n_engines) { *engines = script_engines; diff --git a/modules/thai/thai-ot.c b/modules/thai/thai-ot.c index 00b06380..66c129c4 100644 --- a/modules/thai/thai-ot.c +++ b/modules/thai/thai-ot.c @@ -33,7 +33,7 @@ maybe_add_gsub_feature (PangoOTRuleset *ruleset, gulong property_bit) { guint feature_index; - + /* 0xffff == default language system */ if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB, feature_tag, script_index, 0xffff, &feature_index)) @@ -211,7 +211,7 @@ lao_ot_get_ruleset (PangoFont *font) } -void +void thai_ot_shape (PangoFont *font, PangoGlyphString *glyphs) { diff --git a/modules/thai/thai-ot.h b/modules/thai/thai-ot.h index 35252a7a..de18bcdd 100644 --- a/modules/thai/thai-ot.h +++ b/modules/thai/thai-ot.h @@ -28,7 +28,7 @@ PangoOTRuleset * thai_ot_get_ruleset (PangoFont *font); -void +void thai_ot_shape (PangoFont *font, PangoGlyphString *glyphs); diff --git a/modules/thai/thai-shaper.c b/modules/thai/thai-shaper.c index 409b3083..df6c72f1 100644 --- a/modules/thai/thai-shaper.c +++ b/modules/thai/thai-shaper.c @@ -116,9 +116,9 @@ static const ThaiShapeTable Lao_shape_table = { }; static void -add_glyph (ThaiFontInfo *font_info, - PangoGlyphString *glyphs, - gint cluster_start, +add_glyph (ThaiFontInfo *font_info, + PangoGlyphString *glyphs, + gint cluster_start, PangoGlyph glyph, gboolean combining) { @@ -126,10 +126,10 @@ add_glyph (ThaiFontInfo *font_info, gint index = glyphs->num_glyphs; pango_glyph_string_set_size (glyphs, index + 1); - + glyphs->glyphs[index].glyph = glyph; glyphs->glyphs[index].attr.is_cluster_start = combining ? 0 : 1; - + glyphs->log_clusters[index] = cluster_start; pango_font_get_glyph_extents (font_info->font, @@ -181,7 +181,7 @@ get_adjusted_glyphs_list (ThaiFontInfo *font_info, return 1; } break; - + case 2: if (is_char_type (cluster[0], NoTailCons|BotTailCons|SpltTailCons) && is_char_type (cluster[1], SaraAm)) @@ -278,7 +278,7 @@ get_adjusted_glyphs_list (ThaiFontInfo *font_info, return n; } break; - + case 3: if (is_char_type (cluster[0], NoTailCons|BotTailCons|SpltTailCons) && is_char_type (cluster[1], Tone) && @@ -414,13 +414,13 @@ get_glyphs_list (ThaiFontInfo *font_info, */ return get_adjusted_glyphs_list (font_info, cluster, num_chrs, glyph_lists, &tis620_0_shape_table); - + case THAI_FONT_TIS_MAC: /* MacIntosh Extension */ return get_adjusted_glyphs_list (font_info, cluster, num_chrs, glyph_lists, &Mac_shape_table); - + case THAI_FONT_TIS_WIN: /* Microsoft Extension */ @@ -505,7 +505,7 @@ get_next_cluster(const char *text, const char *p; gint n_chars = 0; gunichar current; - + for (p = text; p < text + length; p = g_utf8_next_char (p)) { current = g_utf8_get_char (p); @@ -523,7 +523,7 @@ get_next_cluster(const char *text, return p; } -void +void thai_engine_shape (PangoEngineShape *engine, PangoFont *font, const char *text, diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index b2e12aff..e4f882a8 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -2,9 +2,9 @@ * tibetan-fc.c: Shaper for Tibetan script * * Copyright (C) 2005 DIT, Government of Bhutan <http://www.dit.gov.bt> - * Contact person : Pema Geyleg <pema_geyleg@druknet.bt> + * Contact person : Pema Geyleg <pema_geyleg@druknet.bt> * - * Based on code from khmer shapers developed by Jens Herden + * Based on code from khmer shapers developed by Jens Herden * <jens@tibetanos.inf > and Javier Sola <javier@tibetanos.info> * * Based on code from other shapers @@ -15,8 +15,8 @@ * Copyright (C) 2001, 2002 IBM Corporation * Author: Eric Mader <mader@jtcsv.com> * - * The first module for Tibetan shaper was developed by Mr. Karunakar under - * PanLocalization project. + * The first module for Tibetan shaper was developed by Mr. Karunakar under + * PanLocalization project. * Mr. Chris Fynn, Mr.Javier Sola, Mr. Namgay Thinley were involved * while developing this shaper. * @@ -98,18 +98,18 @@ static PangoEngineInfo script_engines[] = -// Vocabulary -// Base -> A consonant in its full (not subscript) form. It is the +// Vocabulary +// Base -> A consonant in its full (not subscript) form. It is the // center of the syllable, it can be souranded by subjoined consonants, vowels, // signs... but there is only one base in a stack, it has to be coded as -// the first character of the syllable.Included here are also groups of base + subjoined -// which are represented by one single code point in unicode (e.g. 0F43) Also other characters that might take -// subjoined consonants or other combining characters. -// Subjoined -> Subjoined consonants and groups of subjoined consonants which have a single code-point +// the first character of the syllable.Included here are also groups of base + subjoined +// which are represented by one single code point in unicode (e.g. 0F43) Also other characters that might take +// subjoined consonants or other combining characters. +// Subjoined -> Subjoined consonants and groups of subjoined consonants which have a single code-point // to repersent the group (even if each subjoined consonant is represented independently // by anothe code-point -// Tsa Phru --> Tsa Phru character, Bhutanese people will always place it right after the base, but sometimes, due to -// "normalization" +// Tsa Phru --> Tsa Phru character, Bhutanese people will always place it right after the base, but sometimes, due to +// "normalization" // is placed after all the subjoined consonants, and it is also permitted there. // A Chung Vowel lengthening mark --> . 0F71 It is placed after the base and any subjoined consonants but before any vowels // Precomposed Sanskrit vowels --> The are combinations of subjoined consonants + vowels that have been assigned @@ -117,13 +117,13 @@ static PangoEngineInfo script_engines[] = // They are avoided, and users are encouraged to use the combination of code-points that // represents the same sound instead of using this combined characters. This is included here // for compatibility with possible texts that use them (they are not in the Dzongkha keyboard). -// Halanta -> The Halanta or Virama character 0F84 indicates that a consonant should not use its inheernt vowel, +// Halanta -> The Halanta or Virama character 0F84 indicates that a consonant should not use its inheernt vowel, // in spite of not having other vowels present. It is usually placed immediatly after a base consonant, // but in some special cases it can also be placed after a subjoined consonant, so this is also // permitted in this algorithm. (Halanta is always displayed in Tibetan not used as a connecting char) // // Subjoined vowels -> Dependent vowels (matras) placed below the base and below all subjoined consonants. There -// might be as much as three subjoined vowels in a given stack (only one in general text, but up +// might be as much as three subjoined vowels in a given stack (only one in general text, but up // to three for abreviations, they have to be permitted). // Superscript vowels -> There are three superscript vowels, and they can be repeated or combined (up to three // times. They can combine with subjoined vowels, and are always coded after these. @@ -137,19 +137,19 @@ static PangoEngineInfo script_engines[] = // Digits -> Digits are not considered as non-combining characters because there are a few characters which // combine with them, so they have to be considered independently. // Digit combining marks -> dependent marks that combine with digits. -// +// // TODO // There are a number of characters in the CJK block that are used in Tibetan script, two of these are symbols // are used as bases for combining glyphs, and have not been encoded in Tibetan. As these characters are outside // of the tibetan block, they have not been treated in this program. - + enum TibetanCharClassValues { CC_RESERVED = 0, //Non Combining Characters CC_BASE = 1, // Base Consonants, Base Consonants with Subjoined attached in code point, Sanskrit base marks CC_SUBJOINED = 2, // Subjoined Consonats, combination of more than Subjoined Consonants in the code point - CC_TSA_PHRU = 3, // Tsa-Phru character 0F39 + CC_TSA_PHRU = 3, // Tsa-Phru character 0F39 CC_A_CHUNG = 4, // Vowel Lenthening a-chung mark 0F71 CC_COMP_SANSKRIT = 5, // Precomposed Sanskrit vowels including Subjoined characters and vowels CC_HALANTA = 6, // Halanta Character 0F84 @@ -197,24 +197,24 @@ enum // simple classes, they are used in the statetable (in this file) to control the length of a syllable // they are also used to know where a character should be placed (location in reference to the base character) // and also to know if a character, when independtly displayed, should be displayed with a dotted-circle to - // indicate error in syllable construction - _xx = CC_RESERVED, - _ba = CC_BASE, - _sj = CC_SUBJOINED | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _tp = CC_TSA_PHRU | CF_DOTTED_CIRCLE | CF_POS_ABOVE, - _ac = CC_A_CHUNG | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _cs = CC_COMP_SANSKRIT | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _ha = CC_HALANTA | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _bv = CC_BELOW_VOWEL | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _av = CC_ABOVE_VOWEL | CF_DOTTED_CIRCLE | CF_POS_ABOVE, - _an = CC_ANUSVARA | CF_DOTTED_CIRCLE | CF_POS_ABOVE, - _cb = CC_CANDRABINDU | CF_DOTTED_CIRCLE | CF_POS_ABOVE, - _vs = CC_VISARGA | CF_DOTTED_CIRCLE| CF_POS_AFTER, - _as = CC_ABOVE_S_MARK | CF_DOTTED_CIRCLE | CF_POS_ABOVE, - _bs = CC_BELOW_S_MARK | CF_DOTTED_CIRCLE | CF_POS_BELOW, - _di = CC_DIGIT | CF_DIGIT, - _pd = CC_PRE_DIGIT_MARK | CF_DOTTED_CIRCLE | CF_PREDIGIT | CF_POS_BEFORE , - _bd = CC_POST_BELOW_DIGIT_M | CF_DOTTED_CIRCLE | CF_POS_AFTER + // indicate error in syllable construction + _xx = CC_RESERVED, + _ba = CC_BASE, + _sj = CC_SUBJOINED | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _tp = CC_TSA_PHRU | CF_DOTTED_CIRCLE | CF_POS_ABOVE, + _ac = CC_A_CHUNG | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _cs = CC_COMP_SANSKRIT | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _ha = CC_HALANTA | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _bv = CC_BELOW_VOWEL | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _av = CC_ABOVE_VOWEL | CF_DOTTED_CIRCLE | CF_POS_ABOVE, + _an = CC_ANUSVARA | CF_DOTTED_CIRCLE | CF_POS_ABOVE, + _cb = CC_CANDRABINDU | CF_DOTTED_CIRCLE | CF_POS_ABOVE, + _vs = CC_VISARGA | CF_DOTTED_CIRCLE| CF_POS_AFTER, + _as = CC_ABOVE_S_MARK | CF_DOTTED_CIRCLE | CF_POS_ABOVE, + _bs = CC_BELOW_S_MARK | CF_DOTTED_CIRCLE | CF_POS_BELOW, + _di = CC_DIGIT | CF_DIGIT, + _pd = CC_PRE_DIGIT_MARK | CF_DOTTED_CIRCLE | CF_PREDIGIT | CF_POS_BEFORE , + _bd = CC_POST_BELOW_DIGIT_M | CF_DOTTED_CIRCLE | CF_POS_AFTER }; @@ -246,8 +246,8 @@ static const TibetanCharClass tibetanCharClasses[] = // 0 1 2 3 4 5 6 7 8 9 a b c d e f _xx, _ba, _xx, _xx, _ba, _ba, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0F00 - 0F0F 0 _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _bd, _bd, _xx, _xx, _xx, _xx, _xx, _xx, // 0F10 - 0F1F 1 - _di, _di, _di, _di, _di, _di, _di, _di, _di, _di, _xx, _xx, _xx, _xx, _xx, _xx, // 0F20 - 0F2F 2 - _xx, _xx, _xx, _xx, _xx, _bs, _xx, _bs, _xx, _tp, _xx, _xx, _xx, _xx, _bd, _pd, // 0F30 - 0F3F 3 + _di, _di, _di, _di, _di, _di, _di, _di, _di, _di, _xx, _xx, _xx, _xx, _xx, _xx, // 0F20 - 0F2F 2 + _xx, _xx, _xx, _xx, _xx, _bs, _xx, _bs, _xx, _tp, _xx, _xx, _xx, _xx, _bd, _pd, // 0F30 - 0F3F 3 _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _xx, _ba, _ba, _ba, _ba, _ba, _ba, _ba, // 0F40 - 0F4F 4 _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, // 0F50 - 0F5F 5 _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _xx, _xx, _xx, _xx, _xx, // 0F60 - 0F6F 6 @@ -259,7 +259,7 @@ static const TibetanCharClass tibetanCharClasses[] = _xx, _xx, _xx, _xx, _xx, _xx, _bs, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FC0 - 0FCF c _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx,// 0FD0 - 0FDF d _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FE0 - 0FEF e - _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FF0 - 0FFF f + _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FF0 - 0FFF f }; /* this define must reflect the range of tibetanCharClasses */ @@ -285,9 +285,9 @@ static const gint8 tibetanStateTable[][CC_COUNT] = //xx ba sj tp ac cs ha bv av an cb vs as bs di pd bd { 1, 2, 4, 3, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, 20, 21, 21,}, // 0 - ground state {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 1 - exit state (or sign to the right of the syllable) - {-1, -1, 4, 3, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 2 - Base consonant + {-1, -1, 4, 3, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 2 - Base consonant {-1, -1, 5, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 3 - Tsa phru after base - {-1, -1, 4, 6, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 4 - Subjoined consonant after base + {-1, -1, 4, 6, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 4 - Subjoined consonant after base {-1, -1, 5, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 5 - Subjoined consonant after tsa phru {-1, -1, -1, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 6 - Tsa phru after subjoined consonant {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1,}, // 7 - Pre Composed Sanskrit @@ -295,15 +295,15 @@ static const gint8 tibetanStateTable[][CC_COUNT] = {-1, -1, -1, -1, -1, -1, -1, -1, 14, 13, 17, -1, 19, 19, -1, -1, -1,}, // 9 - Halanta {-1, -1, -1, -1, -1, -1, -1, 11, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 10 - below vowel 1 {-1, -1, -1, -1, -1, -1, -1, 12, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 11 - below vowel 2 - {-1, -1, -1, -1, -1, -1, -1, -1, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 12 - below vowel 3 + {-1, -1, -1, -1, -1, -1, -1, -1, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 12 - below vowel 3 {-1, -1, -1, -1, -1, -1, -1, -1, 14, 17, 17, 18, 19, 19, -1, -1, -1,}, // 13 - Anusvara before vowel {-1, -1, -1, -1, -1, -1, -1, -1, 15, 17, 17, 18, 19, 19, -1, -1, -1,}, // 14 - above vowel 1 {-1, -1, -1, -1, -1, -1, -1, -1, 16, 17, 17, 18, 19, 19, -1, -1, -1,}, // 15 - above vowel 2 {-1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 17, 18, 19, 19, -1, -1, -1,}, // 16 - above vowel 3 - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 19, -1, -1, -1,}, // 17 - Anusvara or Candrabindu after vowel - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1,}, // 18 - Visarga + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 19, -1, -1, -1,}, // 17 - Anusvara or Candrabindu after vowel + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1,}, // 18 - Visarga {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 19 - strss mark - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, 21,}, // 20 - digit + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, 21,}, // 20 - digit {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 21 - digit mark }; @@ -532,19 +532,19 @@ tibetan_engine_shape (PangoEngineShape *engine, } /* If it encounters a digit followed by number pre combining mark, then reorder the two characters - * coeng Ro if they are present + * coeng Ro if they are present */ for (i = cursor; i < syllable; i += 1) { charClass = get_char_class (wcs[i]); - if ((charClass & CF_DIGIT ) + if ((charClass & CF_DIGIT ) && ( get_char_class (wcs[i+1]) & CF_PREDIGIT)) { pango_ot_buffer_add_glyph (buffer, get_index (fc_font, C_PRE_NUMBER_MARK), pref_p, p - text); p = g_utf8_next_char (p); pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), pref_p, p - text); - i += 1; + i += 1; } else { switch (charClass & CF_POS_MASK) { @@ -555,7 +555,7 @@ tibetan_engine_shape (PangoEngineShape *engine, case CF_POS_AFTER : pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), pstf_p, p - text); break; - + case CF_POS_BELOW : pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), blwf_p, p - text); break; @@ -565,8 +565,8 @@ tibetan_engine_shape (PangoEngineShape *engine, pango_ot_buffer_add_glyph (buffer, get_index (fc_font, wcs[i]), default_p, p - text); break; } /* switch */ - } - + } + p = g_utf8_next_char (p); } /* for */ |