* 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.
asac@hector3:~/gnome/pango.trunk.bzr$ bzr diff -c2378 pango/pangofc-fontmap.h
=== modified file 'pango/pangofc-fontmap.h'
--- a/pango/pangofc-fontmap.h 2008-12-08 03:28:29 +0000
+++ b/pango/pangofc-fontmap.h 2009-01-28 22:07:38 +0000
@@ -24,16 +24,34 @@
/**
* PangoFcFontMapClass:
* @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
* of #PangoFcFont when you call g_object_new(). Deprecated
* in favor of @create_font().
* @get_resolution: Gets the resolution (the scale factor
* between logical and absolute font sizes) that the backend
* will use for a particular fontmap and context. @context
@@ -82,35 +100,38 @@ struct _PangoFcFontMap
* and fonts.
* @context_key_copy: Copies a context key. Pango uses this
* to make a persistant copy of the value returned from
* @context_key_get.
* @context_key_free: Frees a context key copied with
* @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.
**/
struct _PangoFcFontMapClass
{
/*< private >*/
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 */
PangoFcFont *(*new_font) (PangoFcFontMap *fontmap, FcPattern *pattern);
bzr log -c2378 ------- ------- ------- ------- ------- ------- ------- ----
-------
revno: 2378
committer: behdad
timestamp: Wed 2009-01-28 22:07:38 +0000
message:
2009-01-09 Behdad Esfahbod <email address hidden>
* docs/pango- sections. txt: pangofc- fontmap. sgml: text-attributes .sgml: o-fc.h: o-fcfont. c (get_font_size), (get_gravity_ class),
(get_ gravity) , (_pango_ cairo_fc_ font_new) : o-fcfontmap. c
(pango_ cairo_fc_ font_map_ font_key_ substitute) ,
(pango_ cairo_fc_ font_map_ create_ font),
(pango_ cairo_fc_ font_map_ class_init) : font.c (_pango_ fc_font_ get_font_ key),
(_pango_ fc_font_ set_font_ key): 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) : fontmap. h: private. h: ~/gnome/ pango.trunk. bzr$ bzr diff -c2378 pango/pangofc- fontmap. h pangofc- fontmap. h' pangofc- fontmap. h 2008-12-08 03:28:29 +0000 pangofc- fontmap. h 2009-01-28 22:07:38 +0000
* docs/tmpl/
* docs/tmpl/
* pango/pangocair
* pango/pangocair
* pango/pangocair
* pango/pangofc-
* pango/pangofc-
* pango/pangofc-
* pango/pangofc-
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.
asac@hector3:
=== modified file 'pango/
--- a/pango/
+++ b/pango/
@@ -24,16 +24,34 @@
#include <fontconfig/ fontconfig. h> pango-fontmap. h> pangofc- decoder. h> pangofc- font.h>
#include <pango/
#include <pango/
#include <pango/
G_BEGIN_DECLS
+/** fc_font_ key_get_ pattern (const PangoFcFontKey *key); fc_font_ key_get_ matrix (const PangoFcFontKey *key); font_key_ get_context_ key (const PangoFcFontKey *key); FC_FONT_ MAP (pango_ fc_font_ map_get_ type ()) FONT_MAP( object) (G_TYPE_ CHECK_INSTANCE_ CAST ((object), PANGO_TYPE_ FC_FONT_ MAP, PangoFcFontMap)) FC_FONT_ MAP(object) (G_TYPE_ CHECK_INSTANCE_ TYPE ((object), PANGO_TYPE_ FC_FONT_ MAP))
+ * PangoFcFontKey:
+ *
+ * An opaque structure containing all the information needed for
+ * loading a font #PangoFcFont.
+ *
+ * Since: 1.24
+ **/
+typedef struct _PangoFcFontKey PangoFcFontKey;
+
+const FcPattern *pango_
+const PangoMatrix *pango_
+gpointer pango_fc_
+
+/*
+ * PangoFcFontMap
+ */
+
#define PANGO_TYPE_
#define PANGO_FC_
#define PANGO_IS_
typedef struct _PangoFcFontMap PangoFcFontMap; Class PangoFcFontMapC lass; Private PangoFcFontMapP rivate;
typedef struct _PangoFcFontMap
typedef struct _PangoFcFontMap
@@ -59,17 +77,17 @@ struct _PangoFcFontMap apPrivate *priv;
PangoFcFontM
};
/** lass: substitute: Substitutes in default values for substitute( ). substitute( ). substitute: Substitutes in default values for substitute: Substitutes in default values for font_key_ get_pattern( ) and must be passed to Class Class parent_class;
* PangoFcFontMapC
* @default_
* 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_
+ * Deprecated in favor of @font_key_
* @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
* of #PangoFcFont when you call g_object_new(). Deprecated
* in favor of @create_font().
* @get_resolution: Gets the resolution (the scale factor
* between logical and absolute font sizes) that the backend
* will use for a particular fontmap and context. @context
@@ -82,35 +100,38 @@ struct _PangoFcFontMap
* and fonts.
* @context_key_copy: Copies a context key. Pango uses this
* to make a persistant copy of the value returned from
* @context_key_get.
* @context_key_free: Frees a context key copied with
* @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_
+ * @font_key_
* 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_
+ * the "pattern" property of #PangoFcFont when you call
+ * g_object_new(). If %NULL, new_font() is used.
+ * (Since: 1.24)
*
* Class structure for #PangoFcFontMap.
**/
struct _PangoFcFontMap
{
/*< private >*/
PangoFontMap
/*< public >*/ substitute) (PangoFcFontMap *fontmap,
FcPattern *pattern);
FcPattern *pattern);
- /* Deprecated in favor of context_substitute */
+ /* Deprecated in favor of font_key_substitute */
void (*default_
/* Deprecated in favor of create_font */
PangoFcFont *(*new_font) (PangoFcFontMap *fontmap,
double (*get_resolution) (PangoFcFontMap *fcfontmap,
PangoContex t *context); Class
gconstpoint er key); key_equal) (PangoFcFontMap *fcfontmap,
gconstpoint er key_a,
gconstpoint er key_b);
@@ -122,23 +143,21 @@ struct _PangoFcFontMap
void (*context_key_free) (PangoFcFontMap *fcfontmap,
gpointer key);
guint32 (*context_key_hash) (PangoFcFontMap *fcfontmap,
gboolean (*context_
- void (*context_ substitute) (PangoFcFontMap *fontmap, key_substitute) (PangoFcFontMap *fontmap,
FcPattern *pattern); ption *desc,
- PangoContext *context,
+ void (*font_
+ PangoFcFontKey *fontkey,
PangoFcFont *(*create_font) (PangoFcFontMap *fontmap,
- PangoContext *context,
- const PangoFontDescri
- FcPattern *pattern);
+ PangoFcFontKey *fontkey);
/*< private >*/
/* Padding for future expansion */
void (*_pango_reserved1) (void);
void (*_pango_reserved2) (void);
void (*_pango_reserved3) (void);
void (*_pango_reserved4) (void);
};