Improve the font options support
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 02:15:56 +0000 (19:15 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 02:15:56 +0000 (19:15 -0700)
Instead of just overwriting the default options, merge the per-widget
font options with the defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=751811

gtk/gtkwidget.c

index 9360f80ff19007def590193f65f3dac18ef2c34a..f53743341823568d64cbd09309f8d1120f5b3a16 100644 (file)
@@ -10338,10 +10338,14 @@ update_pango_context (GtkWidget    *widget,
   screen = gtk_widget_get_screen_unchecked (widget);
   if (widget->priv->font_options)
     {
-      pango_cairo_context_set_font_options (context,
-                                            widget->priv->font_options);
+      cairo_font_options_t *options;
+
+      options = cairo_font_options_copy (gdk_screen_get_font_options (screen));
+      cairo_font_options_merge (options, widget->priv->font_options);
+      pango_cairo_context_set_font_options (context, options);
+      cairo_font_options_destroy (options);
     }
-  else if (screen)
+  else
     {
       pango_cairo_context_set_font_options (context,
                                             gdk_screen_get_font_options (screen));