summaryrefslogtreecommitdiff
path: root/pango/pangocairo-fcfontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2009-01-28 22:07:38 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2009-01-28 22:07:38 +0000
commit4aa395acd2740de461a359cba0068baf3f9a1b1d (patch)
treef0fed4655e64b81759a0980b35887eb1e66b3952 /pango/pangocairo-fcfontmap.c
parentceb03fea0dd21294e5b7eb13d8bc6b94b512037e (diff)
downloadpango-4aa395acd2740de461a359cba0068baf3f9a1b1d.tar.gz
Change PangoFc font loading API such that PangoContext is not passed down.
2009-01-09 Behdad Esfahbod <behdad@gnome.org> * docs/pango-sections.txt: * docs/tmpl/pangofc-fontmap.sgml: * docs/tmpl/text-attributes.sgml: * pango/pangocairo-fc.h: * pango/pangocairo-fcfont.c (get_font_size), (get_gravity_class), (get_gravity), (_pango_cairo_fc_font_new): * pango/pangocairo-fcfontmap.c (pango_cairo_fc_font_map_font_key_substitute), (pango_cairo_fc_font_map_create_font), (pango_cairo_fc_font_map_class_init): * pango/pangofc-font.c (_pango_fc_font_get_font_key), (_pango_fc_font_set_font_key): * pango/pangofc-fontmap.c (pango_fc_font_key_equal), (pango_fc_font_key_hash), (pango_fc_font_key_free), (pango_fc_font_key_copy), (get_context_matrix), (pango_fc_font_key_init), (pango_fc_font_key_get_pattern), (pango_fc_font_key_get_matrix), (pango_fc_font_key_get_context_key), (pango_fc_font_map_init), (pango_fc_font_map_class_init), (pango_fc_font_map_add), (_pango_fc_font_map_remove), (pango_fc_make_pattern), (pango_fc_font_map_new_font), (pango_fc_default_substitute), (pango_fc_font_map_get_patterns), (pango_fc_font_map_load_fontset): * pango/pangofc-fontmap.h: * pango/pangofc-private.h: Change PangoFc font loading API such that PangoContext is not passed down. We use a new opaque struct called PangoFcFontKey. This struct is in fact our font hash key. This avoids problems where previously we were using context members that were not necessarily considered by the pangofc layer when caching. This is in preparation for lazy loading of fonts in the pangofc fontmap. svn path=/trunk/; revision=2804
Diffstat (limited to 'pango/pangocairo-fcfontmap.c')
-rw-r--r--pango/pangocairo-fcfontmap.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/pango/pangocairo-fcfontmap.c b/pango/pangocairo-fcfontmap.c
index 33e94549..c66602b6 100644
--- a/pango/pangocairo-fcfontmap.c
+++ b/pango/pangocairo-fcfontmap.c
@@ -80,14 +80,14 @@ pango_cairo_fc_font_map_finalize (GObject *object)
}
static void
-pango_cairo_fc_font_map_context_substitute (PangoFcFontMap *fcfontmap G_GNUC_UNUSED,
- PangoContext *context,
- FcPattern *pattern)
+pango_cairo_fc_font_map_font_key_substitute (PangoFcFontMap *fcfontmap G_GNUC_UNUSED,
+ PangoFcFontKey *fontkey,
+ FcPattern *pattern)
{
FcConfigSubstitute (NULL, pattern, FcMatchPattern);
- if (context)
- cairo_ft_font_options_substitute (_pango_cairo_context_get_merged_font_options (context),
+ if (fontkey)
+ cairo_ft_font_options_substitute (pango_fc_font_key_get_context_key (fontkey),
pattern);
FcDefaultSubstitute (pattern);
@@ -151,13 +151,11 @@ pango_cairo_fc_font_map_context_key_equal (PangoFcFontMap *fcfontmap G_GNUC_UNUS
}
static PangoFcFont *
-pango_cairo_fc_font_map_create_font (PangoFcFontMap *fcfontmap,
- PangoContext *context,
- const PangoFontDescription *desc,
- FcPattern *pattern)
+pango_cairo_fc_font_map_create_font (PangoFcFontMap *fcfontmap,
+ PangoFcFontKey *key)
{
return _pango_cairo_fc_font_new ((PangoCairoFcFontMap *) (fcfontmap),
- context, desc, pattern);
+ key);
}
static void
@@ -168,7 +166,7 @@ pango_cairo_fc_font_map_class_init (PangoCairoFcFontMapClass *class)
gobject_class->finalize = pango_cairo_fc_font_map_finalize;
- fcfontmap_class->context_substitute = pango_cairo_fc_font_map_context_substitute;
+ fcfontmap_class->font_key_substitute = pango_cairo_fc_font_map_font_key_substitute;
fcfontmap_class->get_resolution = pango_cairo_fc_font_map_get_resolution_fc;
fcfontmap_class->context_key_get = pango_cairo_fc_font_map_context_key_get;