summaryrefslogtreecommitdiff
path: root/pango/pangoft2-fontmap.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-02-26 10:46:28 +0100
committerAlexander Larsson <alexl@redhat.com>2013-02-26 10:49:55 +0100
commitc5f43d1869373d9e05588c9a13841b5416583e29 (patch)
treeda3b0a3e3066178abd7d7534d34a82f46dcd35c5 /pango/pangoft2-fontmap.c
parent6de9b3b340e30856daefc418dc59545afbe62bf0 (diff)
downloadpango-c5f43d1869373d9e05588c9a13841b5416583e29.tar.gz
Add pango_font_map_changed()
This is needed as a base class sometimes needs to invalidate the fontmap. https://bugzilla.gnome.org/show_bug.cgi?id=694626
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r--pango/pangoft2-fontmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 46808889..aed5a234 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -68,6 +68,7 @@ static PangoFcFont * pango_ft2_font_map_new_font (PangoFcFontMap
static double pango_ft2_font_map_get_resolution (PangoFcFontMap *fcfontmap,
PangoContext *context);
static guint pango_ft2_font_map_get_serial (PangoFontMap *fontmap);
+static void pango_ft2_font_map_changed (PangoFontMap *fontmap);
static PangoFT2FontMap *pango_ft2_global_fontmap = NULL; /* MT-safe */
@@ -82,6 +83,7 @@ pango_ft2_font_map_class_init (PangoFT2FontMapClass *class)
gobject_class->finalize = pango_ft2_font_map_finalize;
fontmap_class->get_serial = pango_ft2_font_map_get_serial;
+ fontmap_class->changed = pango_ft2_font_map_changed;
fcfontmap_class->default_substitute = _pango_ft2_font_map_default_substitute;
fcfontmap_class->new_font = pango_ft2_font_map_new_font;
fcfontmap_class->get_resolution = pango_ft2_font_map_get_resolution;
@@ -154,6 +156,16 @@ pango_ft2_font_map_get_serial (PangoFontMap *fontmap)
return ft2fontmap->serial;
}
+static void
+pango_ft2_font_map_changed (PangoFontMap *fontmap)
+{
+ PangoFT2FontMap *ft2fontmap = PANGO_FT2_FONT_MAP (fontmap);
+
+ ft2fontmap->serial++;
+ if (ft2fontmap->serial == 0)
+ ft2fontmap->serial++;
+}
+
/**
* pango_ft2_font_map_set_default_substitute:
* @fontmap: a #PangoFT2FontMap