diff options
author | Owen Taylor <otaylor@redhat.com> | 2003-08-03 21:57:35 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-08-03 21:57:35 +0000 |
commit | 2584212cd0976f5f95d9381e829917e7d2a10d28 (patch) | |
tree | 5773e9f6802f8316c5c7463aa55677babe67343c /pango/pango-context.c | |
parent | 95a8d1788e884b7d8d29d4171a1adc51c61e880e (diff) | |
download | pango-2584212cd0976f5f95d9381e829917e7d2a10d28.tar.gz |
Make PangoEngine{,Lang,Shape} GObjects, and use a GTypeModule-based
Sat Aug 2 23:19:16 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-engine.[ch] modules/*/*-{fc,win32,x}.c
pango/modules.c pango/break.c pango/pango-context.c
pango/pango-layout.c pango/pango-modules.h
pango/querymodules.c pango/shape.c: Make
PangoEngine{,Lang,Shape} GObjects, and use a
GTypeModule-based module-loading system closely based
on the one used for GtkIMContext and GtkThemeEngine.
* pango/pango-impl-utils.h: OK, I'm tired of typing
in get_type() functions.
* pango/pango-script.[ch] pango/pango-script-table.h
tests/testscript.c tools/gen-script-table.pl: Add port
of script-range code from ICU in preparation for future
use. (#91542)
* tools/gen-script-for-lang.c: Utility program to determine
the script for each fontconfig .orth file.
* docs/tmpl/{scripts.sgml,pango-engine-lang.sgml,
pango-engine-shape.sgml} docs/pango-sections.txt docs/pango-docs.sgml:
Redo to go along with the above changes.
* configure.in: chmod +x tests/runtests.sh
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r-- | pango/pango-context.c | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c index 99407d85..8f9de155 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -25,6 +25,7 @@ #include "pango/pango-context.h" #include "pango/pango-utils.h" +#include "pango-engine.h" #include "pango-modules.h" struct _PangoContext @@ -495,66 +496,6 @@ pango_itemize (PangoContext *context, return g_list_reverse (result); } -static void -fallback_engine_shape (PangoFont *font, - const char *text, - gint length, - PangoAnalysis *analysis, - PangoGlyphString *glyphs) -{ - int n_chars; - int i; - const char *p; - - g_return_if_fail (font != NULL); - g_return_if_fail (text != NULL); - g_return_if_fail (length >= 0); - g_return_if_fail (analysis != NULL); - - n_chars = g_utf8_strlen (text, length); - pango_glyph_string_set_size (glyphs, n_chars); - - p = text; - i = 0; - while (i < n_chars) - { - glyphs->glyphs[i].glyph = 0; - - glyphs->glyphs[i].geometry.x_offset = 0; - glyphs->glyphs[i].geometry.y_offset = 0; - glyphs->glyphs[i].geometry.width = 0; - - glyphs->log_clusters[i] = p - text; - - ++i; - p = g_utf8_next_char (p); - } -} - -static PangoCoverage* -fallback_engine_get_coverage (PangoFont *font, - PangoLanguage *lang) -{ - PangoCoverage *result = pango_coverage_new (); - - /* We return an empty coverage (this function won't get - * called, but if it is, empty coverage will keep - * it from being used). - */ - - return result; -} - -static PangoEngineShape fallback_shaper = { - { - "FallbackScriptEngine", - PANGO_ENGINE_TYPE_SHAPE, - sizeof (PangoEngineShape) - }, - fallback_engine_shape, - fallback_engine_get_coverage -}; - static gboolean advance_iterator_to (PangoAttrIterator *iterator, int start_index) @@ -683,7 +624,7 @@ add_engines (PangoContext *context, analysis->shape_engine = NULL; if (analysis->shape_engine == NULL) - analysis->shape_engine = &fallback_shaper; + analysis->shape_engine = pango_get_fallback_shaper (); analysis->extra_attrs = extra_attrs; } |