diff options
author | Caleb Hearon <crh0872@gmail.com> | 2020-06-08 22:22:55 +0000 |
---|---|---|
committer | Caleb Hearon <crh0872@gmail.com> | 2020-06-13 03:29:35 +0000 |
commit | e023cf0d66b323359740c453481507ab91005a34 (patch) | |
tree | 75171773d024713c7103d13c3764223908f7df8b /pango/pangoft2-fontmap.c | |
parent | 79baf68b39e7654f8f00c60c8a86ef6054a391dc (diff) | |
download | pango-e023cf0d66b323359740c453481507ab91005a34.tar.gz |
add pango_fc_font_map_set_default_substitute
added:
pango_fc_font_map_set_default_substitute
pango_fc_font_map_default_substitute_changed
deprecated:
pango_ft2_font_map_set_default_substitute
pango_ft2_font_map_changed
pango_xft_font_map_set_default_substitute
pango_xft_font_map_changed
Now PangoCairoFcFontMap will call what is passed to
pango_fc_font_map_set_default_substitute when it is time.
The deprecated functions make calls to the parent (FC) class now.
The user-supplied callbacks are executed in the exact same places as
before.
Diffstat (limited to 'pango/pangoft2-fontmap.c')
-rw-r--r-- | pango/pangoft2-fontmap.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c index 60ca3e79..4fb64616 100644 --- a/pango/pangoft2-fontmap.c +++ b/pango/pangoft2-fontmap.c @@ -52,13 +52,6 @@ struct _PangoFT2FontMap double dpi_x; double dpi_y; - /* Function to call on prepared patterns to do final - * config tweaking. - */ - PangoFT2SubstituteFunc substitute_func; - gpointer substitute_data; - GDestroyNotify substitute_destroy; - PangoRenderer *renderer; }; @@ -117,9 +110,6 @@ pango_ft2_font_map_finalize (GObject *object) if (ft2fontmap->renderer) g_object_unref (ft2fontmap->renderer); - if (ft2fontmap->substitute_destroy) - ft2fontmap->substitute_destroy (ft2fontmap->substitute_data); - G_OBJECT_CLASS (pango_ft2_font_map_parent_class)->finalize (object); FT_Done_FreeType (ft2fontmap->library); @@ -176,6 +166,9 @@ pango_ft2_font_map_changed (PangoFontMap *fontmap) * the font. This function can be used to do things like set * hinting and antialiasing options. * + * Deprecated: 1.46: Use pango_fc_font_map_set_default_substitute() + * instead. + * * Since: 1.2 **/ void @@ -184,18 +177,8 @@ pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap, gpointer data, GDestroyNotify notify) { - fontmap->serial++; - if (fontmap->serial == 0) - fontmap->serial++; - - 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_cache_clear (PANGO_FC_FONT_MAP (fontmap)); + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (fontmap); + pango_fc_font_map_set_default_substitute(fcfontmap, func, data, notify); } /** @@ -208,15 +191,15 @@ pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap, * That is, if your substitution function will return different * results for the same input pattern, you must call this function. * + * Deprecated: 1.46: Use pango_fc_font_map_substitute_changed() + * instead. + * * Since: 1.2 **/ void pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap) { - fontmap->serial++; - if (fontmap->serial == 0) - fontmap->serial++; - pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); + pango_fc_font_map_substitute_changed(PANGO_FC_FONT_MAP (fontmap)); } /** @@ -363,8 +346,8 @@ _pango_ft2_font_map_default_substitute (PangoFcFontMap *fcfontmap, FcConfigSubstitute (NULL, pattern, FcMatchPattern); - if (ft2fontmap->substitute_func) - ft2fontmap->substitute_func (pattern, ft2fontmap->substitute_data); + if (fcfontmap->substitute_func) + fcfontmap->substitute_func (pattern, fcfontmap->substitute_data); if (FcPatternGet (pattern, FC_DPI, 0, &v) == FcResultNoMatch) FcPatternAddDouble (pattern, FC_DPI, ft2fontmap->dpi_y); |