Keep settings in Write

Share uncovered secrets, useful notes, guides and hacks!

Keep settings in Write

Postby krid » Fri Jan 22, 2010 7:46 am

Hi All,
How can we retain settings in Wirte?
In our school we use a sans serif font and for pupils a large size like 32.
Thanks in advance for your help,
kind regards,
Dirk
krid
 
Posts: 2
Joined: Fri Jan 22, 2010 7:28 am

Re: Keep settings in Write

Postby ektoric » Mon Jan 25, 2010 7:07 pm

krid wrote:and for pupils a large size like 32.

By "pupils", do you mean students? Or eyes? Or perhaps the students' eyes? :lol:

Unfortunately, the Write activity hardcodes those values. Fortunately, they are coded in the toolbar.py file.

(All of the below steps are done in a Terminal shell, with 'sudo' permissions.)
1) First, find your Write.activity directory. Depending on which version you have, they may be in different places. so I can't really help you there. If you really can't find it, try to "find" it
Code: Select all
# find / -name Write.activity

2) Edit the toolbar.py file. (Most people are not familiar with vi, so try the nano editor.)
Code: Select all
# nano Write.activity/toolbar.py

3) Find the constructor for the TextToolbar class
Code: Select all
class TextToolbar(gtk.Toolbar):
    (...)
    def __init__(self, toolbox, abiword_canvas):

4) A little further down (line 306 for my version), you will see where they set the font size:
Code: Select all
             if s == '12':
                 self._font_size_combo.set_active(i)

Change that value to:
Code: Select all
             if s == '36':

5) A little further down (line 319 for my version), you will see where they set the font face:
Code: Select all
             if f == 'Times New Roman':
                 self._font_combo.set_active(i)

Change that value to the font name of your choice. Be sure to be careful about capitalization and spaces.

Yes, you will have to do this for each XO, and you will have to do this each time you do an update. Unfortunately these settings were not designed as configurable items. If you would like to make a feature request, we can start by going to the OLPC's Write Activity page. There we see that it is maintained by Sugarlabs. Finally, we can find their bugtracker at http://dev.sugarlabs.org/. I imagine that from here, you can create an account and log an "enhancement" bug to request that they add this feature to be configurable, as opposed to hard coded.
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Keep settings in Write

Postby krid » Wed Jan 27, 2010 2:22 pm

Dear Ektonic,

[quote]By "pupils", do you mean students? Or eyes? Or perhaps the students' eyes? :lol: [/quote]

ROTFLO!!

Thank you very much for your replies. We will try the 'per XO' option. But, more important, we will use your suggestion to ask for a feature at Sugarlabs.
In a primary shcool in the Netherlands, no reading method uses a serif font. As you can imagine, it's too complicated to set font and size individually, every time the XO is used.
IMHO this feature is also important for other countries.
Thanks again for your help,
kind regards,
Dirk
krid
 
Posts: 2
Joined: Fri Jan 22, 2010 7:28 am

Re: Keep settings in Write

Postby ektoric » Wed Jan 27, 2010 3:34 pm

I hope the solution works, and you are able to save your pupils' pupils!
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX


Return to Tips, Tricks & Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest