From 0f36f55ee0e7c9bf224fabbaf31843b3868f213c Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 23 Sep 2003 23:11:59 +0000 Subject: Modules now declare a list of scripts that they cover instead of a list of Tue Sep 23 18:03:57 2003 Owen Taylor * pango/pango-engines.[ch] pango/pango-engines-private.h: Modules now declare a list of scripts that they cover instead of a list of code point ranges. Also, there is now a ->covers() virtual function that allows a module to decide live whether the font covers a particular codepoint; remove old get_coverage() method. * pango/pango-fontset.[ch]: Add a foreach() function to iterate over all the fonts in a fontset (with a true return stopping iteration). * pango/pango-context.c: Complete rewrite using script-run information to improve language tags. Switch to an approach where we handle one run at a time rather than computing information for each character individually then later breaking the result into runs. * pango/pango-fontset.[ch]: Switch over to using pango-impl-utils.h. * modules/basic/basic-x.c pango/pangox-fontmap.c: Adapt to the change from get_coverage => covers. * pango/pango-modules.h pango/modules.c: Switch PangoMap over to being based on script rather than being based on codepoint. Remove the no longer needed pango_map_get_entry(). * pango/modules.c: Handle new script-based modules. * pango/pango-fc-fontmap.c pango/pango-win32-fontmap.c pango/pang-fontmap.[ch]: Add a shape_engine_type field to PangoFontmapClass, pango_font_map_get_shape_engine_type(); this allows generic code to find a shaper for a particular fontmap. * pango/pango-script.[ch]: Add pango_script_get_sample_language(), pango_language_includes_script(); functions for determining the relationship between scripts and language. * tools/gen-script-for-lang.c: Modify to spit out a useful table. * pango/pango-script-lang-table.h: Version of table generated from current fontconfig data. * pango/pangox.c: Remove complicated code to compute coverages; no longer useful now that we just have the basic shaper as a legacy thing. * modules/*/*.c: Adapt to identifying shape engines by language range. * modules/thai/thai-fc.c modules/thai/thai-shaper.[ch]: Remove now unused "has_glyph" function and XTIS support. * modules/thai/thai-fc.c: Handle non-Thai characters as well, since the Thai module now gets spaces, punctuation, and so forth. --- modules/indic/indic-fc.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'modules/indic/indic-fc.c') diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index f70fadfb..68b28662 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -52,12 +52,10 @@ struct _PangoIndicInfo #define ENGINE_SUFFIX "ScriptEngineFc" #define RENDER_TYPE PANGO_RENDER_TYPE_FC -#define INDIC_ENGINE_INFO(script) {#script ENGINE_SUFFIX, PANGO_ENGINE_TYPE_SHAPE, RENDER_TYPE, script##_ranges, G_N_ELEMENTS(script##_ranges)} +#define INDIC_ENGINE_INFO(script) {#script ENGINE_SUFFIX, PANGO_ENGINE_TYPE_SHAPE, RENDER_TYPE, script##_scripts, G_N_ELEMENTS(script##_scripts)} #define PANGO_INDIC_INFO(script) {OT_TAG_##script, &script##_class_table, "pango-indic-" #script "-GSUB-ruleset", "pango-indic-" #script "-GPOS-rulsest"} -#define INDIC_SCRIPT_RANGE(script) {SCRIPT_RANGE_##script, "*"} - #define OT_TAG_deva FT_MAKE_TAG('d','e','v','a') #define OT_TAG_beng FT_MAKE_TAG('b','e','n','g') #define OT_TAG_guru FT_MAKE_TAG('g','u','r','u') @@ -68,40 +66,40 @@ struct _PangoIndicInfo #define OT_TAG_knda FT_MAKE_TAG('k','n','d','a') #define OT_TAG_mlym FT_MAKE_TAG('m','l','y','m') -static PangoEngineRange deva_ranges[] = { - INDIC_SCRIPT_RANGE(deva), /* Devanagari */ +static PangoEngineScriptInfo deva_scripts[] = { + { PANGO_SCRIPT_DEVANAGARI, "*" } }; -static PangoEngineRange beng_ranges[] = { - INDIC_SCRIPT_RANGE(beng), /* Bengali */ +static PangoEngineScriptInfo beng_scripts[] = { + {PANGO_SCRIPT_BENGALI, "*" } }; -static PangoEngineRange guru_ranges[] = { - INDIC_SCRIPT_RANGE(guru), /* Gurmukhi */ +static PangoEngineScriptInfo guru_scripts[] = { + { PANGO_SCRIPT_GURMUKHI, "*" } }; -static PangoEngineRange gujr_ranges[] = { - INDIC_SCRIPT_RANGE(gujr), /* Gujarati */ +static PangoEngineScriptInfo gujr_scripts[] = { + { PANGO_SCRIPT_GUJARATI, "*" } }; -static PangoEngineRange orya_ranges[] = { - INDIC_SCRIPT_RANGE(orya), /* Oriya */ +static PangoEngineScriptInfo orya_scripts[] = { + { PANGO_SCRIPT_ORIYA, "*" } }; -static PangoEngineRange taml_ranges[] = { - INDIC_SCRIPT_RANGE(taml), /* Tamil */ +static PangoEngineScriptInfo taml_scripts[] = { + { PANGO_SCRIPT_TAMIL, "*" } }; -static PangoEngineRange telu_ranges[] = { - INDIC_SCRIPT_RANGE(telu), /* Telugu */ +static PangoEngineScriptInfo telu_scripts[] = { + { PANGO_SCRIPT_TELUGU, "*" } }; -static PangoEngineRange knda_ranges[] = { - INDIC_SCRIPT_RANGE(knda), /* Kannada */ +static PangoEngineScriptInfo knda_scripts[] = { + { PANGO_SCRIPT_KANNADA, "*" } }; -static PangoEngineRange mlym_ranges[] = { - INDIC_SCRIPT_RANGE(mlym), /* Malayalam */ +static PangoEngineScriptInfo mlym_scripts[] = { + { PANGO_SCRIPT_MALAYALAM, "*" } }; static PangoEngineInfo script_engines[] = { -- cgit v1.2.1