diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-11-22 18:50:30 -0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-11-22 18:50:30 -0800 |
commit | 3e5769aca2200b9f20614b1b9ec71f1bcf057ffe (patch) | |
tree | 81e56d060f55941481633720ffe96f99942b2bad /pango/pangocairo-context.c | |
parent | 0813fcabf5b13b2b90780ec45f3018ad00927da5 (diff) | |
download | pango-3e5769aca2200b9f20614b1b9ec71f1bcf057ffe.tar.gz |
[pangocairo] Pick up font-options from cairo_t
Now one can use cairo_set_font_options(), whereas before they had to
use pango_cairo_context_set_font_options(). If the latter is used,
it will override the former.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=790747
Diffstat (limited to 'pango/pangocairo-context.c')
-rw-r--r-- | pango/pangocairo-context.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pango/pangocairo-context.c b/pango/pangocairo-context.c index 9dd02351..5949c448 100644 --- a/pango/pangocairo-context.c +++ b/pango/pangocairo-context.c @@ -32,6 +32,7 @@ typedef struct _PangoCairoContextInfo PangoCairoContextInfo; struct _PangoCairoContextInfo { double dpi; + gboolean set_options_explicit; cairo_font_options_t *set_options; cairo_font_options_t *surface_options; @@ -108,6 +109,12 @@ _pango_cairo_update_context (cairo_t *cr, if (!info->surface_options) info->surface_options = cairo_font_options_create (); cairo_surface_get_font_options (target, info->surface_options); + if (!info->set_options_explicit) + { + if (!info->set_options) + info->set_options = cairo_font_options_create (); + cairo_get_font_options (cr, info->set_options); + } old_merged_options = info->merged_options; info->merged_options = NULL; @@ -244,9 +251,15 @@ pango_cairo_context_set_font_options (PangoContext *context, cairo_font_options_destroy (info->set_options); if (options) + { info->set_options = cairo_font_options_copy (options); + info->set_options_explicit = TRUE; + } else + { info->set_options = NULL; + info->set_options_explicit = FALSE; + } if (info->merged_options) { |