diff options
author | Alexander Larsson <alexl@redhat.com> | 2000-12-21 09:54:01 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2000-12-21 09:54:01 +0000 |
commit | e763eba74d05d9b8948cd5bfa05ab7056f4c52e8 (patch) | |
tree | ea783760274470968a6be3d27e3ef740c635bc44 /modules | |
parent | b00ec4cbd9b6f08884d5ae01099be5f4dc854693 (diff) | |
download | pango-e763eba74d05d9b8948cd5bfa05ab7056f4c52e8.tar.gz |
Change usage to say pango-config instead of glib-config. Add support for
2000-12-21 Alexander Larsson <alexl@redhat.com>
* pango-config.in:
Change usage to say pango-config instead of glib-config.
Add support for pangoft2.
* modules/basic/Makefile.am:
Compile and install pango-basic-ft2 if freetype was found.
* modules/basic/basic-ft2.c:
Remove lang engine. Make the glyph from the glyph index instead
of the unicode index. The id is really BasicScriptEngineFT2.
* pango/Makefile.am:
Compile and install pangoft2 if freetype was found.
* pango/pangoft2-fontcache.c (pango_ft2_font_cache_load):
Init face->generic.data to 0, since this field will be used
to cache the current size of the face.
* pango/pangoft2-fontmap.c (pango_ft2_font_map_for_display):
Use g_object_new instead of g_type_create_instance.
(pango_ft2_font_entry_get_coverage): Use G_DIR_SEPARATOR_S
instead of \\. (pango_ft2_font_entry_get_coverage): Init result
to NULL. Don't write to file if open failed.
* pango/pangoft2-private.h:
Add PangoFT2GlyphInfo.
* pango/pangoft2.c (pango_ft2_get_face): Export function, and make
sure it sets the correct face size. (pango_ft2_load_font,
pango_ft2_get_per_char, pango_ft2_font_get_kerning):
PANGO_FT2_GLYPH_INDEX stores the glyph index, not the unicode value.
(pango_ft2_font_get_glyph_extents): Cache glyph extents.
(pango_ft2_has_glyph): Remove function.
(pango_ft2_font_finalize): Free glyph info cache.
* pango/pangoft2.h:
Export pango_ft2_get_face, remove pango_ft2_has_glyph.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/basic/Makefile.am | 13 | ||||
-rw-r--r-- | modules/basic/basic-ft2.c | 22 |
2 files changed, 23 insertions, 12 deletions
diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am index 389013aa..af7cd382 100644 --- a/modules/basic/Makefile.am +++ b/modules/basic/Makefile.am @@ -8,13 +8,20 @@ else XFT_MODULES= endif +if HAVE_FREETYPE +FT2_MODULES=pango-basic-ft2.la +else +FT2_MODULES= +endif + + if INCLUDE_BASIC noinst_LTLIBRARIES = libpango-basic.la moddefine = -DMODULE_PREFIX else moduledir = $(libdir)/pango/modules -module_LTLIBRARIES = $(XFT_MODULES) pango-basic.la +module_LTLIBRARIES = $(FT2_MODULES) $(XFT_MODULES) pango-basic.la moduleflags=-rpath $(libdir) endif @@ -35,6 +42,10 @@ pango_basic_xft_la_LDFLAGS = -rpath $(libdir) -export-dynamic -avoid-version -mo pango_basic_xft_la_LIBADD = pango_basic_xft_la_SOURCES = basic-xft.c +pango_basic_ft2_la_LDFLAGS = -rpath $(libdir) -export-dynamic -avoid-version -module +pango_basic_ft2_la_LIBADD = $(FREETYPE_LIBS) +pango_basic_ft2_la_SOURCES = basic-ft2.c + EXTRA_DIST = \ tables-big.i \ tables-small.i \ diff --git a/modules/basic/basic-ft2.c b/modules/basic/basic-ft2.c index d09c4c41..ed0f3e98 100644 --- a/modules/basic/basic-ft2.c +++ b/modules/basic/basic-ft2.c @@ -20,6 +20,7 @@ */ #include <glib.h> +#include <string.h> #include "pango-layout.h" #include "pangoft2.h" @@ -122,12 +123,13 @@ find_char (PangoFont *font, for (i = 0; i < n_subfonts; i++) { - PangoGlyph glyph; + FT_Face face; + FT_UInt index; - glyph = PANGO_FT2_MAKE_GLYPH (i+1, wc); - - if (pango_ft2_has_glyph (font, glyph)) - return glyph; + face = pango_ft2_get_face (font, i+1); + index = FT_Get_Char_Index (face, wc); + if (index && index <= face->num_glyphs) + return PANGO_FT2_MAKE_GLYPH (i+1, index); } return 0; @@ -281,9 +283,9 @@ basic_engine_get_coverage (PangoFont *font, const char *lang) { PangoCoverage *result = pango_coverage_new (); - gunichar wc; - #if 0 + gunichar wc; + for (wc = 0; wc < 65536; wc++) if (find_char (font, wc)) pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT); @@ -300,7 +302,7 @@ basic_engine_ft2_new (void) result = g_new (PangoEngineShape, 1); - result->engine.id = "BasicScriptEngine"; + result->engine.id = "BasicScriptEngineFT2"; result->engine.type = PANGO_ENGINE_TYPE_SHAPE; result->engine.length = sizeof (result); result->script_shape = basic_engine_shape; @@ -329,9 +331,7 @@ MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, PangoEngine * MODULE_ENTRY(script_engine_load) (const char *id) { - if (!strcmp (id, "BasicScriptEngineLangFT2")) - return basic_engine_lang_new (); - else if (!strcmp (id, "BasicScriptEngineFT2")) + if (!strcmp (id, "BasicScriptEngineFT2")) return basic_engine_ft2_new (); else return NULL; |