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

Tomeu Vizoso tomeu at sugarlabs.org
Fri Jun 5 04:40:26 EDT 2009


On Fri, Jun 5, 2009 at 00:12, James Simmons<jim.simmons at walgreens.com> wrote:
> Tomeu,
>
> Did you have a chance to try my Activity now that it has a font problem?
> Any ideas?

Sorry, haven't had time yet, please ping me again until I do it.

> Also, is there some way I could tell if my Activity was running on an XO and
> adjust the font size accordingly?

You could, but activities shouldn't have to worry about it, because
for an activity author is close to impossible to anticipate to all the
hardware out there and plan for it.

X desktops including Sugar have mechanisms for scaling the font size
given by applications so it ends up having a correct font size on the
screen. For some reason (a bug in the geode driver?) X is unable to
determine the correct resolution of the XO display so we are using a
hack in SoaS so that X knows it. This hack has been broken in recent
SoaS images but has been fixed in the last image.

Could you give it a try and see?

Thanks,

Tomeu

> James Simmons
>
>
> Tomeu Vizoso wrote:
>
> On Mon, Jun 1, 2009 at 18:26, James Simmons <jim.simmons at walgreens.com>
> wrote:
>
>
> 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.
>
>
> Hmm, setting a fixed font size of 10 should give you the same font
> size as used anywhere in the UI.
>
>
>
> 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))
>
>
> We don't need to scale ourselves any more because Pango is already
> doing it for us.
>
> In the last soas image I have (almost one month old), the XO has a
> very small font size, not sure why but I will try a more recent one.
>
> Regards,
>
> Tomeu
>
>
>
> It did not have any effect.
>
> Thanks,
>
> James Simmons
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
>


More information about the Sugar-devel mailing list