[IAEP] Set GNU GPL in monospace font
Ryan Cunningham
rvskmbrly3 at gmail.com
Sat Feb 15 13:43:35 EST 2014
Are any of you convinced to set the GNU GPL in a monospace font in the 'About My Computer' control panel? If so, here's a patch for it (at the bottom).
The GNU GPL text file (v2.0) looks quite bad in a proportional font; but someone over at your GitHub repositories said that proportional fonts are better for dyslexic people.
Here, I import an additional standard PyGTK class, "Pango" (from the module "gi.repository"), to handle font switching.
---
diff --git a/extensions/cpsection/aboutcomputer/view.py b/extensions/cpsection/aboutcomputer/view.py
index 6235e5c..5714145 100644
--- a/extensions/cpsection/aboutcomputer/view.py
+++ b/extensions/cpsection/aboutcomputer/view.py
@@ -18,7 +18,7 @@
from gettext import gettext as _
-from gi.repository import Gtk
+from gi.repository import Gtk, Pango
from gi.repository import Gdk
from sugar3.graphics import style
@@ -206,6 +206,8 @@ def license_expander_cb(self, expander, param_spec):
view_license = Gtk.TextView()
view_license.set_editable(False)
view_license.get_buffer().set_text(self._model.get_license())
+ fd = Pango.FontDescription('Monospace')
+ view_license.modify_font(fd)
view_license.show()
expander.add(view_license)
else:
More information about the IAEP
mailing list