summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-07-21 13:55:19 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-07-21 13:55:19 +0000
commit6f1def024e5c0c0f75c992c26dded3c192aa455c (patch)
tree2ef6a8974d23d58dff51473c9691ab5785bdc4c6 /pango/pangofc-fontmap.h
parent07085142899378e7b5c0ad8e3fdd35ea2a941b1a (diff)
downloadpango-6f1def024e5c0c0f75c992c26dded3c192aa455c.tar.gz
Rework handling of context-specific options: drop get_render_key() and add
2005-07-19 Owen Taylor <otaylor@redhat.com> * pango/pango-fcfontmap.[ch]: Rework handling of context-specific options: drop get_render_key() and add a opaque "context key" (get_context_key() and friends). Also add a function to get the resolution. * pango/pango-fcfontmap.c pango/pangofc-font.h: - Move the 'lang' into the fontset key lookup and get rid of the funky list-of-hash-tables - Make lookups of fontsets and fonts dependent on the context key for the context. - Simplify the pattern/fontset caching to have one finite-size cache rather than an infinite first-level and a finite-size second level. * pango/pangocairo.h pango/pangocairo-private.h pango/pangocairo-fontmap.c: Add pango_cairo_context_get/set_resolution(), pango_cairo_context_set/get_font_options to allow controlling the resolution and font rendering options for a specific PangoContext. * pango/pangocairo-fcfont.c pango/pangocairo-fcfontmap pango/pangocairo-win32font.c: Implement resolution and font options handling adapt to related Cairo changes. * docs/pango-sections.txt docs/Makefile.am pango/pangowin32.c: Doc updates and build fixes. * pango/pangofc-fontmap.c (pango_fc_make_pattern): Create patterns with FC_SIZE as well as FC_PIXEL_SIZE to work around a libgnomeprint bug. (#309477)
Diffstat (limited to 'pango/pangofc-fontmap.h')
-rw-r--r--pango/pangofc-fontmap.h49
1 files changed, 38 insertions, 11 deletions
diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h
index a6f4d511..7e339542 100644
--- a/pango/pangofc-fontmap.h
+++ b/pango/pangofc-fontmap.h
@@ -64,22 +64,38 @@ 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().
* @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_render_key: Given a context and font description,
- * calculate a "key" of X and Y sizes and a flags word
- * that can be used to hash the results of loading a font
- * with that information. If %NULL, a default implementation
- * is used.
+ * @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
+ * may be null.
+ * @context_key_get: Gets an opaque key holding backend
+ * specific options for the context that will affect
+ * fonts created by create_font(). The result must point to
+ * persistant storage owned by the fontmap. This key
+ * is used to index hash tables used to look up fontsets
+ * 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
+ * unspecified fields in a #FcPattern. This will be called
+ * prior to creating a font for the pattern. May be %NULL.
*
* Class structure for #PangoFcFontMap.
**/
@@ -96,12 +112,21 @@ struct _PangoFcFontMapClass
PangoFcFont *(*new_font) (PangoFcFontMap *fontmap,
FcPattern *pattern);
- gboolean (*get_render_key) (PangoFcFontMap *fcfontmap,
- PangoContext *context,
- const PangoFontDescription *desc,
- int *xsize,
- int *ysize,
- guint *flags);
+ double (*get_resolution) (PangoFcFontMap *fcfontmap,
+ PangoContext *context);
+
+ gconstpointer (*context_key_get) (PangoFcFontMap *fcfontmap,
+ PangoContext *context);
+ gpointer (*context_key_copy) (PangoFcFontMap *fcfontmap,
+ gconstpointer key);
+ void (*context_key_free) (PangoFcFontMap *fcfontmap,
+ gpointer key);
+ guint32 (*context_key_hash) (PangoFcFontMap *fcfontmap,
+ gconstpointer key);
+ gboolean (*context_key_equal) (PangoFcFontMap *fcfontmap,
+ gconstpointer key_a,
+ gconstpointer key_b);
+
void (*context_substitute) (PangoFcFontMap *fontmap,
PangoContext *context,
FcPattern *pattern);
@@ -114,6 +139,8 @@ struct _PangoFcFontMapClass
/* Padding for future expansion */
void (*_pango_reserved1) (void);
void (*_pango_reserved2) (void);
+ void (*_pango_reserved3) (void);
+ void (*_pango_reserved4) (void);
};
PangoContext * pango_fc_font_map_create_context (PangoFcFontMap *fcfontmap);