[Sugar-devel] More information on font scaling problem

Tomeu Vizoso tomeu at sugarlabs.org
Mon Jun 8 07:01:21 EDT 2009


On Mon, Jun 8, 2009 at 12:35, Albert Cahalan<acahalan at gmail.com> wrote:
> Tomeu Vizoso wrote:
>
>> In 0.84 Pango knows the resolution of the screen and scales all
>> fonts accordingly. This means that by using, say 10, the font
>> will always look good in all hw.
>
> I wish this were so. Consider 3 ways to measure font size:
>
> 1. number of pixels
> 2. physical size on the screen
> 3. angular size (depends on physical size and viewer distance)
>
> For readability, both #1 and #3 have lower limits. That "10"
> you feed into Pango has nothing to do with either; it's #2.
> On the screen, almost nobody actually cares about #2. Lots
> of systems lie about it, including Browse.
>
> Normally people sit far away from a large screen. If we assume
> that people tend to fill their eye's viewing area with the
> screen, then pixels per character should scale according to
> the number of pixels across the screen. (diagonal perhaps)
>
> Most everything tends to break down when using a projector.
> You may be at 5 DPI, yet the angular size is smaller than
> normal.
>
> A practical way to size things is to make font and icon pixel
> dimensions scale with the square root of the screen pixel
> dimensions. Tux Paint does this for stamps. Like this:
>
> d = sqrt(x*x+y*y); // diagonal screen size in pixels
> d0 = sqrt(x0*x0+y0*y0); // same, for a standard reference screen
> s = sqrt(d)/sqrt(d0); // scale factor
>
> So if the reference is 640x480 and you want to display on a
> 2560x1920 display, the scale factor is 2.
>
> (the idea is that people want to use extra resolution both for
> more object detail and more objects; this splits the usage)

Agreed, and if you add to the mix bugs in software other than Sugar
and the fact that not everybody has the same visual perception then we
cannot use a single function of any values we may have available.

Pango is using the Xft.dpi resource to scale the size given by the
user software. Distributors of software on known hardware can set this
value in ~/.Xresources and would be great if users ha a more obvious
way to set it to their preference. I think that Sugar would need to
have a settings daemon in order to allow changing it dynamically
without restarting Sugar, but would be great if someone could give it
a look and report back.

Regards,

Tomeu


More information about the Sugar-devel mailing list