[Sugar-devel] FWD: Sugar font size & wiki

Walter Bender walter.bender at gmail.com
Wed Apr 22 16:22:39 EDT 2009


Here's what I do in Turtle Art:


def draw_text(t, label, x, y, size, w):
    t.gc.set_foreground(t.tw.textcolor)
    fd = pango.FontDescription('Sans')
    fd.set_size(int(size)*pango.SCALE)
    pl = t.tw.window.create_pango_layout(str(label))
    pl.set_font_description(fd)
    pl.set_width(int(w)*pango.SCALE)
    t.canvas.image.draw_layout(t.gc,int(x),int(y),pl)

I use a scale factor of 1.6 to convert between XO and non-XO displays.

-walter

On Wed, Apr 22, 2009 at 2:22 PM, Christoph Derndorfer
<christoph.derndorfer at gmail.com> wrote:
> 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 ---
>> Two issues become urgent now:
>>
>> # Sugar does _not_ accept our way of specifying the font size:
>>
>>        self.toggle_equal = gtk.ToggleButton("<==>")
>>        self.toggle_equal.modify_font(pango.FontDescription("sans 72"))
>>        self.toggle_equal.connect("toggled", self.toggle_equal_callback)
>>        self.settings_table.attach(self.toggle_equal, 3, 4, 11, 12 )
>>        self.toggle_equal.show()
>>
>>   With this code the font size is taken as a (too small) default, and we
>> would like to
>>   deliver ReckonPrimer1.0 as soon as possible
> --- snip ---
>
> --
> Christoph Derndorfer
> co-editor, olpcnews
> url: www.olpcnews.com
> e-mail: christoph at olpcnews.com
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list