summaryrefslogtreecommitdiff
path: root/modules/arabic/arabic-xft.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2002-06-04 00:20:51 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-06-04 00:20:51 +0000
commitffcea1aa2e1c0f8a46b26bf90444942c421418ba (patch)
treedc6fb251146c49ea7422e05660e4568a8e724e46 /modules/arabic/arabic-xft.c
parent8de41bc064a69ead1e38ca8c8b6483bb34b98d64 (diff)
downloadpango-ffcea1aa2e1c0f8a46b26bf90444942c421418ba.tar.gz
on Jun 3 18:56:09 2002 Owen Taylor <otaylor@redhat.com>
Xft2 and fontconfig conversion, based largely on a patch from Keith Packard. * configure.in acconfig.h: Add checks for fontconfig, switch Xft checks to switch for Xft2 using pkg-config. * pangoxft.pc.in pangoxft.pc.in modules/{arabic,basic,hebrew,indic,tamil}/Makefile.am pango/Makefile.am: Reflect new Xft/fontconfig dependencies. * pango/pangoxft-private.h pango/pangoxft-fontmap.c modules/arabic/arabic-xft.c modules/indic/indic-xft.c: Switch over to using Xft2 and fontconfig. * pango/pangoft2.c pango/pangoft2-fontmap.c pango/pangoft2-private.h pango/pango/Makefile.am: Remove usage of mini-xft in favor of fontconfig. * pango/pango-ot.h pango/opentype/pango-ot-info.c pango/pangoxft.h modules/arabic/arabic-{xft,ft2}.c modules/indic/indic-xft.c: Attach OpenType information directly to the FT_Face structure using FT_Generic. * modules/tamil/Makefile.am modules/tamil/tamil-xft.c configure.in: Remove this module, no longer needed. * pango/pangoxft-font.c (pango_xft_real_render): Coalesce calls to Xft rendering functions.
Diffstat (limited to 'modules/arabic/arabic-xft.c')
-rw-r--r--modules/arabic/arabic-xft.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/modules/arabic/arabic-xft.c b/modules/arabic/arabic-xft.c
index 0771d6df..e0ddc696 100644
--- a/modules/arabic/arabic-xft.c
+++ b/modules/arabic/arabic-xft.c
@@ -61,12 +61,12 @@ maybe_add_feature (PangoOTRuleset *ruleset,
}
static PangoOTRuleset *
-get_ruleset (PangoFont *font)
+get_ruleset (FT_Face face)
{
PangoOTRuleset *ruleset;
static GQuark ruleset_quark = 0;
- PangoOTInfo *info = pango_xft_font_get_ot_info (font);
+ PangoOTInfo *info = pango_ot_info_get (face);
if (!ruleset_quark)
ruleset_quark = g_quark_from_string ("pango-arabic-ruleset");
@@ -74,7 +74,7 @@ get_ruleset (PangoFont *font)
if (!info)
return NULL;
- ruleset = g_object_get_qdata (G_OBJECT (font), ruleset_quark);
+ ruleset = g_object_get_qdata (G_OBJECT (info), ruleset_quark);
if (!ruleset)
{
@@ -93,7 +93,7 @@ get_ruleset (PangoFont *font)
maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('l','i','g','a'), 0xFFFF);
}
- g_object_set_qdata_full (G_OBJECT (font), ruleset_quark, ruleset,
+ g_object_set_qdata_full (G_OBJECT (info), ruleset_quark, ruleset,
(GDestroyNotify)g_object_unref);
}
@@ -127,17 +127,6 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl
glyphs->log_clusters[i] = offset;
}
-static guint
-find_char (FT_Face face, PangoFont *font, gunichar wc)
-{
- int index = FT_Get_Char_Index (face, wc);
-
- if (index && index <= face->num_glyphs)
- return index;
- else
- return 0;
-}
-
static void
arabic_engine_shape (PangoFont *font,
const char *text,
@@ -158,13 +147,13 @@ arabic_engine_shape (PangoFont *font,
g_return_if_fail (length >= 0);
g_return_if_fail (analysis != NULL);
- face = pango_xft_font_get_face (font);
+ face = pango_xft_font_lock_face (font);
g_assert (face);
n_chars = g_utf8_strlen (text, length);
pango_glyph_string_set_size (glyphs, n_chars);
- ruleset = get_ruleset (font);
+ ruleset = get_ruleset (face);
if (ruleset)
{
wcs = g_utf8_to_ucs4_fast (text, length, NULL);
@@ -209,7 +198,7 @@ arabic_engine_shape (PangoFont *font,
((properties[i] & (initial | medial)) != (initial | medial)))
wc = 0x64a;
- index = find_char (face, font, wc);
+ index = pango_xft_font_get_glyph (font, wc);
if (!index)
{
@@ -247,7 +236,7 @@ arabic_engine_shape (PangoFont *font,
p = g_utf8_next_char (p);
}
- ruleset = get_ruleset (font);
+ ruleset = get_ruleset (face);
if (ruleset)
{
@@ -297,6 +286,8 @@ arabic_engine_shape (PangoFont *font,
start = end;
}
}
+
+ pango_xft_font_unlock_face (font);
}
static PangoCoverage *