[Sugar-devel] Setting default font size in Write activity

Tomeu Vizoso tomeu at sugarlabs.org
Wed Sep 23 10:27:41 EDT 2009


On Wed, Sep 23, 2009 at 15:27, Emiliano Pastorino
<epastorino at plan.ceibal.edu.uy> wrote:
> Hi, everyone
>
> I've been asked to set a larger font size by default in Write activity for
> children who are visually impaired.
> I tried to edit "toolbar.py" like this:
>
> ...
> ...
> for i, s in enumerate(self._font_sizes):
>     self._font_size_combo_append_item(i, s, None)
>     if s == '12':
>         self._font_size_combo.set_active(i)
> ...
> ...
>
> I turned that '12' into a '48', but default size is still fixed at '12'.

Hi,

that will make the option in the size combobox to be 48, but doesn't
change the size in the canvas. For changing the font size in the
canvas this should work:

self.abiword_canvas.set_font_size('48')

You can place this line in __map_event_cb in AbiwordActivity.py.

Though, in this case it may be better to set the zoom size. You can do
that with:

self.abiword_canvas.set_zoom_percentage(400)

Hope that helps,

Tomeu

-- 
«Sugar Labs is anyone who participates in improving and using Sugar.
What Sugar Labs does is determined by the participants.» - David
Farning


More information about the Sugar-devel mailing list