summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-09-24 17:40:46 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-09-24 17:40:46 +0000
commit0b140650f239bd8fec38c9e5a2d09e95dd8440c0 (patch)
treef5e9cda843855b2f5fbd2be472269660ead9aac3 /pango/pangoft2-fontmap.c
parent763ab93cb59c0f3ff1b540afbbe1b5a689d2a4fb (diff)
downloadpango-0b140650f239bd8fec38c9e5a2d09e95dd8440c0.tar.gz
Up version to 1.7.0.
Fri Sep 24 12:59:22 2004 Owen Taylor <otaylor@redhat.com> * configure.in: Up version to 1.7.0. * pango/pango-renderer.[ch] pango/pango.h pango/Makefile.am: Add PangoRenderer, a base class that is subclassed to produce rendering drivers for different backends and purposes. * pango/pangoft2-private.h pango/pangoft2-render.c pango/pangoft2.c: Move rendering into pangoft2-render.c, use PangoRenderer. * pango/pangoft2-fontmap.c pango/pangoft2-private.h: Add _pango_ft2_font_map_get_renderer() to retrieve a singleton fontmap for the fontmap. * pango/pangoxft-render.[ch] pango/pangoxft.c pango/Makefile.am: Make Xft rendering use PangoRenderer, add publically visible, subclassable PangoXftRenderer. * pango/pangoxft-fontmap.c pango/pangoxft-private.h: Add _pango_xft_font_map_get_renderer() to retrieve a singleton fontmap for the fontmap. * examples/xftview.c examples/Makefile.am: Add a test program using the Xft backend. * docs/*: Update minimally for PangoRenderer.
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 723fb495..43607b07 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -60,6 +60,8 @@ struct _PangoFT2FontMap
PangoFT2SubstituteFunc substitute_func;
gpointer substitute_data;
GDestroyNotify substitute_destroy;
+
+ PangoRenderer *renderer;
};
struct _PangoFT2FontMapClass
@@ -101,6 +103,9 @@ pango_ft2_font_map_finalize (GObject *object)
{
PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (object);
+ if (ft2fontmap->renderer)
+ g_object_unref (ft2fontmap->renderer);
+
if (ft2fontmap->substitute_destroy)
ft2fontmap->substitute_destroy (ft2fontmap->substitute_data);
@@ -303,6 +308,24 @@ _pango_ft2_font_map_get_library (PangoFontMap *fontmap)
return ft2fontmap->library;
}
+
+/**
+ * _pango_ft2_font_map_get_renderer:
+ * @fontmap: a #PangoFT2Fontmap
+ *
+ * Gets the singleton PangoFT2Renderer for this fontmap.
+ *
+ * Return value:
+ **/
+PangoRenderer *
+_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap)
+{
+ if (!ft2fontmap->renderer)
+ ft2fontmap->renderer = g_object_new (PANGO_TYPE_FT2_RENDERER, NULL);
+
+ return ft2fontmap->renderer;
+}
+
static void
pango_ft2_font_map_default_substitute (PangoFcFontMap *fcfontmap,
FcPattern *pattern)