<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre wrap="">Christoph,
I ran into similar issues with fonts in Read Etexts. This is the code I use to increase or decrease font sizes:
def font_decrease(self):
font_size = self.font_desc.get_size() / 1024
font_size = font_size - 1
if font_size < 1:
font_size = 1
self.font_desc.set_size(font_size * 1024)
self.textview.modify_font(self.font_desc)
def font_increase(self):
font_size = self.font_desc.get_size() / 1024
font_size = font_size + 1
self.font_desc.set_size(font_size * 1024)
self.textview.modify_font(self.font_desc)
Apparently pygtk's idea of font size is based on something other than point size. I don't remember all the details but I'm pretty sure this is from the PyGTK tutorial, and it does work.
James Simmons
Message: 3
Date: Wed, 22 Apr 2009 20:22:37 +0200
From: Christoph Derndorfer <a class="moz-txt-link-rfc2396E"
href="mailto:christoph.derndorfer@gmail.com"><christoph.derndorfer@gmail.com></a>
Subject: [Sugar-devel] FWD: Sugar font size & wiki
To: Sugar Devel <a class="moz-txt-link-rfc2396E"
href="mailto:sugar-devel@lists.sugarlabs.org"><sugar-devel@lists.sugarlabs.org></a>
Cc: Christoph Derndorfer <a class="moz-txt-link-rfc2396E"
href="mailto:e0425826@student.tuwien.ac.at"><e0425826@student.tuwien.ac.at></a>,        Stefan Heher
        <a class="moz-txt-link-rfc2396E" href="mailto:heher@sbox.tugraz.at"><heher@sbox.tugraz.at></a>, Walther Neuper <a
class="moz-txt-link-rfc2396E" href="mailto:neuper@ist.tugraz.at"><neuper@ist.tugraz.at></a>,        Patrick
        Loder <a class="moz-txt-link-rfc2396E"
href="mailto:patlod@sbox.tugraz.at"><patlod@sbox.tugraz.at></a>
Message-ID: <a class="moz-txt-link-rfc2396E"
href="mailto:49EF606D.8040003@gmail.com"><49EF606D.8040003@gmail.com></a>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dear all,
a small team of students and a professor at the Technical University
Graz (in CC) is currently working on an activity to exercise Maths based
on the requests by the teachers of our small Austrian OLPC / Sugar pilot.
Anyway, they're currently running into some issues wrt to setting the
font-size in their activity, please see the message below for details.
Any help or pointers to possible solutions would be greatly appreciated!
Thanks in advance,
Christoph
Walther Neuper schrieb:
--- snip ---
</pre>
<blockquote type="cite">
<pre wrap=""><span class="moz-txt-citetags">> </span>Two issues become urgent now:
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span># Sugar does <span
class="moz-txt-underscore"><span class="moz-txt-tag">_</span>not<span
class="moz-txt-tag">_</span></span> accept our way of specifying the font size:
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span> self.toggle_equal = gtk.ToggleButton("<==>")
<span class="moz-txt-citetags">> </span> self.toggle_equal.modify_font(pango.FontDescription("sans 72"))
<span class="moz-txt-citetags">> </span> self.toggle_equal.connect("toggled", self.toggle_equal_callback)
<span class="moz-txt-citetags">> </span> self.settings_table.attach(self.toggle_equal, 3, 4, 11, 12 )
<span class="moz-txt-citetags">> </span> self.toggle_equal.show()
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span> With this code the font size is taken as a (too small) default, and we
<span class="moz-txt-citetags">> </span>would like to
<span class="moz-txt-citetags">> </span> deliver ReckonPrimer1.0 as soon as possible
</pre>
</blockquote>
<pre wrap=""><!---->--- snip ---
<div class="moz-txt-sig">--
Christoph Derndorfer
co-editor, olpcnews
url: <a class="moz-txt-link-abbreviated" href="http://www.olpcnews.com">www.olpcnews.com</a>
e-mail: <a class="moz-txt-link-abbreviated"
href="mailto:christoph@olpcnews.com">christoph@olpcnews.com</a>
</div></pre>
</body>
</html>