diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-09-18 19:17:32 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-09-18 19:17:32 +0000 |
commit | 3d1240ae397d1637be6887815221bc17112ad4ce (patch) | |
tree | 1d71eb13e526ac0b3a19b2aaba0610160976c81e /pango/pangofc-fontmap.c | |
parent | d3d211a0e8ce537da876ddce7c442b2d4a6197a6 (diff) | |
parent | e023cf0d66b323359740c453481507ab91005a34 (diff) | |
download | pango-3d1240ae397d1637be6887815221bc17112ad4ce.tar.gz |
Merge branch 'ch/83' into 'master'
Add pango_fc_font_map_set_default_substitute
Closes #83
See merge request GNOME/pango!191
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r-- | pango/pangofc-fontmap.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index bd15bf2a..e120d305 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -1340,6 +1340,9 @@ pango_fc_font_map_finalize (GObject *object) pango_fc_font_map_shutdown (fcfontmap); + if (fcfontmap->substitute_destroy) + fcfontmap->substitute_destroy (fcfontmap->substitute_data); + G_OBJECT_CLASS (pango_fc_font_map_parent_class)->finalize (object); } @@ -1801,6 +1804,28 @@ pango_fc_default_substitute (PangoFcFontMap *fontmap, PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute (fontmap, pattern); } +void +pango_fc_font_map_set_default_substitute (PangoFcFontMap *fontmap, + PangoFcSubstituteFunc func, + gpointer data, + GDestroyNotify notify) +{ + if (fontmap->substitute_destroy) + fontmap->substitute_destroy (fontmap->substitute_data); + + fontmap->substitute_func = func; + fontmap->substitute_data = data; + fontmap->substitute_destroy = notify; + + pango_fc_font_map_substitute_changed (fontmap); +} + +void +pango_fc_font_map_substitute_changed (PangoFcFontMap *fontmap) { + pango_fc_font_map_cache_clear(fontmap); + pango_font_map_changed(PANGO_FONT_MAP (fontmap)); +} + static double pango_fc_font_map_get_resolution (PangoFcFontMap *fcfontmap, PangoContext *context) |