Blame SOURCES/0007-GSettingsFontButtonTweak-filter-out-fonts-that-gtk-3.patch

445904
From ee8fd31e73104313a4c564e55fd1a74e7000e0cc Mon Sep 17 00:00:00 2001
445904
From: Rui Matos <tiagomatos@gmail.com>
445904
Date: Thu, 5 Dec 2013 23:07:41 +0100
445904
Subject: [PATCH 7/8] GSettingsFontButtonTweak: filter out fonts that gtk+ 3
445904
 doesn't honor
445904
445904
---
445904
 gtweak/widgets.py | 12 ++++++++++++
445904
 1 file changed, 12 insertions(+)
445904
445904
diff --git a/gtweak/widgets.py b/gtweak/widgets.py
445904
index 3c8b6a3..0b75279 100644
445904
--- a/gtweak/widgets.py
445904
+++ b/gtweak/widgets.py
445904
@@ -288,8 +288,20 @@ class GSettingsFontButtonTweak(Gtk.Box, _GSettingsTweak, _DependableMixin):
445904
         Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
445904
         _GSettingsTweak.__init__(self, name, schema_name, key_name, **options)
445904
 
445904
+        def font_filter(family, face, data):
445904
+            desc = face.describe()
445904
+            if (desc.get_style() != Pango.Style.NORMAL or
445904
+                desc.get_variant() != Pango.Variant.NORMAL or
445904
+                desc.get_weight() != Pango.Weight.NORMAL or
445904
+                desc.get_stretch() != Pango.Stretch.NORMAL):
445904
+                return False
445904
+            else:
445904
+                return True
445904
+
445904
         w = Gtk.FontButton()
445904
         w.set_use_font(True)
445904
+        if key_name == "font-name":
445904
+            w.set_filter_func(font_filter, None)
445904
         self.settings.bind(key_name, w, "font-name", Gio.SettingsBindFlags.DEFAULT)
445904
         build_label_beside_widget(name, w, hbox=self)
445904
         self.widget_for_size_group = w
445904
-- 
445904
2.9.3
445904