[gtk+] settings: Never override some font properties



commit fe61e6b3fe5776af3e86f7e4f976205ebc67a449
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 1 00:18:01 2012 +0100

    settings: Never override some font properties
    
    According to the CSS specification, everything but font-size and
    font-family are defined by CSS. So we don't override them anymore.

 gtk/gtksettings.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 2ba95ad..819966b 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1428,23 +1428,12 @@ settings_ensure_style (GtkSettings *settings)
 
   font_desc = pango_font_description_from_string (font_name);
 
-  /* Unset normal attributes from this description,
+  /* Unset attributes from this description,
    * so they do not override theme values */
-  if (pango_font_description_get_weight (font_desc) == PANGO_WEIGHT_NORMAL)
-    pango_font_description_unset_fields (font_desc,
-                                         PANGO_FONT_MASK_WEIGHT);
-
-  if (pango_font_description_get_stretch (font_desc) == PANGO_STRETCH_NORMAL)
-    pango_font_description_unset_fields (font_desc,
-                                         PANGO_FONT_MASK_STRETCH);
-
-  if (pango_font_description_get_variant (font_desc) == PANGO_VARIANT_NORMAL)
-    pango_font_description_unset_fields (font_desc,
-                                         PANGO_FONT_MASK_VARIANT);
-
-  if (pango_font_description_get_style (font_desc) == PANGO_STYLE_NORMAL)
-    pango_font_description_unset_fields (font_desc,
-                                         PANGO_FONT_MASK_STYLE);
+  pango_font_description_unset_fields (font_desc, PANGO_FONT_MASK_WEIGHT);
+  pango_font_description_unset_fields (font_desc, PANGO_FONT_MASK_STRETCH);
+  pango_font_description_unset_fields (font_desc, PANGO_FONT_MASK_VARIANT);
+  pango_font_description_unset_fields (font_desc, PANGO_FONT_MASK_STYLE);
 
   gtk_style_properties_set (priv->style, 0,
                             "font", font_desc,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]