Re: layout units in UnixPangoGraphics

From: <msevior_at_physics.unimelb.edu.au>
Date: Sat Oct 21 2006 - 16:37:58 CEST

>
> Hi Tomas,
> I've looked through the PangoGraphics class code and there is a
> fundamental thing about the layout units calculation I don't
> understand.
>
> The UnixGraphics class calculates all the character meterics at 1440 dpi.
> All the fonts used at the different zooms are calculated relative to this.
>
> I can't see where you do this in the pangoGraphics class. How do you
> decide which font size to use at which resolution for Pango? Where do you
> do the layout units calculation?
>

Hi Tomas,
         OK I've looked more thoroughly at the code now.

The UnixGraphics code works by allocating a font at 1440 DPI and doing all
layout calculations at that resolution.

The PangoGraphics code does not appears to do this. Instead you scale up
from the current font to the layout resolution.

This defeats the purpose of the of the high resolution font and explains
the small discrepencies (of the order of 1%) between the calculated text
widths for screen layout and print layout.

I suggest that we also allocate a layout resolution font at 1440 dpi xft
font for both screen and printing and do all our width and height
calculations on the 1440 dpi font, then scale it down to screen and print
resolution.

What do you think? This way we are gaurenteed to keep WYSIWYG behaviour
and is how we made this work for the UnixFont class.

Cheers

Martin

> Cheers
>
> Martin
>
>
>
Received on Sat Oct 21 16:38:52 2006

This archive was generated by hypermail 2.1.8 : Sat Oct 21 2006 - 16:38:52 CEST