[Sugar-devel] Differing font sizes on the XO and in Sugar Emulation

James Simmons jim.simmons at walgreens.com
Mon Jun 1 12:26:25 EDT 2009


This weekend I attempted to resolve a bug report on Read Etexts where 
there was some strange behavior with font resizing.  When I investigated 
I remembered how this bug came to be.

It seems that if you DON'T explicitly set a font in your Sugar Activity 
it will look identical in sugar-emulator and on an XO.  Unfortunately if 
you *do* set a font what looks like a reasonable sized font in the 
development environment will be a MUCH LARGER font on the XO.  My goal 
with Read Etexts was to give a text view with the default font and allow 
the users to make it larger or smaller, just like Read has the Zoom In 
and Zoom Out feature.  Now there does not seem to be a way to find out 
what font a text viewer is currently using.  All you can do, from what I 
have seen, is to set it to a font and then change the font you have 
set.  I wanted to set it to "sans 12".  Looks good in sugar-emulator, 
ridiculously large on the XO.

Any insight on this problem would be appreciated.  I tried the following 
code from one of Tomeu's postings:

from sugar.graphics import style
pango.FontDescription("sans %d" % style.zoom(72))

It did not have any effect.

Thanks,

James Simmons




More information about the Sugar-devel mailing list