[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font sizes

From: John Darrington
Subject: Re: font sizes
Date: Mon, 28 Jun 2010 05:34:31 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jun 27, 2010 at 03:53:53PM -0700, Ben Pfaff wrote:

     My experience is:
             * For on-screen display, pango_font_description_set_size
               is correct, because it scales fonts by the same factor
               as other programs on my computer (106 dpi for my
               machine), so fonts look the same size as with other
             * For PDF, pango_font_description_set_size does the wrong
               thing.  I think that this is because it *still* scales
               fonts by the fontconfig dpi.  10pt * (106/72) is
               14.7pt, so that would explain the huge fonts in my
             * For PDF, pango_font_description_set_absolute_size does
               the right thing, because the PSPP cairo driver is
               designed so that cairo device units match Pango font
               units 1:1 so that I can be less confused while working
               on the code.
The documentation for pango_cairo_font_map_set_resolution says:

 This is a scale factor between points specified in a PangoFontDescription and 
 Cairo units. The default value is 96, meaning that a 10 point font will be 
 13 units high. (10 * 96. / 72. = 13.3).

I agree that the docs are not terribly helpful.

It would seem that we have "Pango Units", "Cairo Units", and "points".  We need 
to be very carefull which we are using.  My approach to similar problems in the 
has been to set the ratio between the units relatively high (say 5:1) during 
That way it's obvious when the wrong one has been used.  Setting them equal (or 
means that one can easily overlook an incorrect use.


PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]