[Sugar-devel] F11 for XO1 - Fonts
Daniel Drake
dsd at laptop.org
Mon Aug 31 22:59:48 EDT 2009
2009/9/1 Art Hunkins <abhunkin at uncg.edu>:
> I've developed a way to handle fonts both on the XO-1 and on SoaS that fits
> text nicely, on fixed pages, to all-sized screens.
It seems to me like you have this working on 2 screen sizes, but it
certainly won't apply to them all.
You seem to make assumptions like that if 50 characters at a specific
font size can fit on a screen that is 600 pixels wide, then 100
characters will fit on a screen that is 1200 pixels wide. And that's
not how displays and font sizes work.
The number of lines that can fit on a screen (at a certain font size)
does not depend on the aspect ratio, it depends on the physical size
of the screen.
The correct way to do this is to render the fonts and measure the
resultant number of pixels occupied by them, then dynamically adjust.
You can discover the approximate size of a character of a font (in
pixels) to seed the process. Pango provides you all you need to do
this.
Daniel
More information about the Sugar-devel
mailing list