summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.h
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/pangofc-fontmap.h
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/pangofc-fontmap.h')
-rw-r--r--pango/pangofc-fontmap.h47
1 files changed, 33 insertions, 14 deletions
diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h
index fe1e1b5b..6ae73ce2 100644
--- a/pango/pangofc-fontmap.h
+++ b/pango/pangofc-fontmap.h
@@ -29,6 +29,24 @@
G_BEGIN_DECLS
+/**
+ * PangoFcFontKey:
+ *
+ * An opaque structure containing all the information needed for
+ * loading a font #PangoFcFont.
+ *
+ * Since: 1.24
+ **/
+typedef struct _PangoFcFontKey PangoFcFontKey;
+
+const FcPattern *pango_fc_font_key_get_pattern (const PangoFcFontKey *key);
+const PangoMatrix *pango_fc_font_key_get_matrix (const PangoFcFontKey *key);
+gpointer pango_fc_font_key_get_context_key (const PangoFcFontKey *key);
+
+/*
+ * PangoFcFontMap
+ */
+
#define PANGO_TYPE_FC_FONT_MAP (pango_fc_font_map_get_type ())
#define PANGO_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT_MAP, PangoFcFontMap))
#define PANGO_IS_FC_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT_MAP))
@@ -64,7 +82,7 @@ struct _PangoFcFontMap
* @default_substitute: Substitutes in default values for
* unspecified fields in a #FcPattern. This will be called
* prior to creating a font for the pattern. May be %NULL.
- * Deprecated in favor of @context_substitute().
+ * Deprecated in favor of @font_key_substitute().
* @new_font: Creates a new #PangoFcFont for the specified
* pattern of the appropriate type for this font map. The
* @pattern argument must be passed to the "pattern" property
@@ -87,15 +105,18 @@ struct _PangoFcFontMap
* @context_key_copy.
* @context_key_hash: Gets a hash value for a context key
* @context_key_equal: Compares two context keys for equality.
- * @create_font: Creates a new #PangoFcFont for the specified
- * pattern of the appropriate type for this font map using
- * information from the context that is passed in. The
- * @pattern argument must be passed to the "pattern" property
- * of #PangoFcFont when you call g_object_new(). Deprecated
- * in favor of @create_font(). If %NULL, new_font() is used.
- * @context_substitute: Substitutes in default values for
+ * @font_key_substitute: Substitutes in default values for
* unspecified fields in a #FcPattern. This will be called
* prior to creating a font for the pattern. May be %NULL.
+ * (Since: 1.24)
+ * @create_font: Creates a new #PangoFcFont for the specified
+ * pattern of the appropriate type for this font map using
+ * information from the font key that is passed in. The
+ * @pattern member of @font_key can be retrieved using
+ * pango_fc_font_key_get_pattern() and must be passed to
+ * the "pattern" property of #PangoFcFont when you call
+ * g_object_new(). If %NULL, new_font() is used.
+ * (Since: 1.24)
*
* Class structure for #PangoFcFontMap.
**/
@@ -105,7 +126,7 @@ struct _PangoFcFontMapClass
PangoFontMapClass parent_class;
/*< public >*/
- /* Deprecated in favor of context_substitute */
+ /* Deprecated in favor of font_key_substitute */
void (*default_substitute) (PangoFcFontMap *fontmap,
FcPattern *pattern);
/* Deprecated in favor of create_font */
@@ -127,13 +148,11 @@ struct _PangoFcFontMapClass
gconstpointer key_a,
gconstpointer key_b);
- void (*context_substitute) (PangoFcFontMap *fontmap,
- PangoContext *context,
+ void (*font_key_substitute)(PangoFcFontMap *fontmap,
+ PangoFcFontKey *fontkey,
FcPattern *pattern);
PangoFcFont *(*create_font) (PangoFcFontMap *fontmap,
- PangoContext *context,
- const PangoFontDescription *desc,
- FcPattern *pattern);
+ PangoFcFontKey *fontkey);
/*< private >*/
/* Padding for future expansion */