cairo: Fix handling of font sizes. 20100702040502/pspp 20100703040502/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 29 Jun 2010 23:59:42 +0000 (16:59 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 29 Jun 2010 23:59:42 +0000 (16:59 -0700)
commit47e2b1135eaaf7a43915326cd854a6479ed81c42
treecae786db148879cccf4c93df6d82d97664085fa0
parent511fa997d9324c4ab6536c604ec9e0461062e1fc
cairo: Fix handling of font sizes.

Until now this code used pango_font_description_set_absolute_size() to set
the font size.  This sets the font size in device units, e.g. pixels on a
display.  But font sizes are actual specified by the user in points, so
we should instead use pango_font_description_get_size().  This commit
makes that change.

That change is simple, but it necessitates a larger change.
Until now the cairo driver has just assumed that the size of a font is
the size that we assigned it.  But this is no longer the case, since
points and pixels are now different.  So now we measure the actual width
and height of characters and use those as the font size.  At the same
time, the code no longer ignores font sizes included as part of font
description strings, and allows different fonts to have different sizes.

With plenty of help from John Darrington.
src/output/cairo.c
tests/output/render-test.c