[cairo] Points vs device units (PDF surface + Pango)

Mikael Claesson miclaes at yahoo.com
Wed Feb 7 10:47:08 UTC 2018


Hi,

I'm having some trouble with Pango and the PDF backend. I'm wondering what the device unit is for PDF surfaces. I would have expected it to be points. But if it was then wouldn't these two calls be equivalent?

      pango_font_description_set_size( font_desc, 12 * PANGO_SCALE );

      pango_font_description_set_absolute_size( font_desc, 12 * PANGO_SCALE );

I'm getting different text sizes, with a ratio close to 72:96.

What confuses me most it that to get the same text size as I get in LibreOffice when using  the same font I need to specify the absolute size, which does seem to indicate that the device unit is indeed points? So why doesn't pango_font_description_set_size() work? It is as if Pango doesn't know what the ratio between points and device units should be for the surface. Almost as if it believes that it is an image surface with 96 DPI?

So, is pango_font_description_set_absolute_size() the correct function to use for PDF surfaces?

Best regards,

Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180207/1b1966d7/attachment.html>


More information about the cairo mailing list