[cairo] PDF: Font size is rounded
ajohnson at redneon.com
Fri Apr 1 11:52:48 UTC 2016
On 01/04/16 21:03, Kouhei Sutou wrote:
> The specified font size of scaled TrueType font is rounded
> when PDF surface is used. Is it the expected behavior?
The PDF surface should turn off hinting metrics when generating PDF
output. Have you tried checking the metrics returned by
cairo_scaled_font_glyph_extents()?. Use cairo_set_font_options() to turn
off hinting metrics when doing this.
> Here is a program that reproduces the behavior:
> Here is the output of the program:
> 8.000, 8.125, 8.250 and 8.375 are the same font size.
> 8.500, ... and 9.375 are the same font size.
> It's caused since FreeType 2.4.6. FreeType 2.4.6 includes
> the change:
> If I revert the change by
> https://savannah.nongnu.org/bugs/download.php?file_id=36807 ,
> the program outputs the following PDF:
> In the PDF, 8.000 and 8.125 are the different font size.
> I send a question about whether the change is expected or
> not to FreeType developers
> https://savannah.nongnu.org/bugs/?47582 , a developer said
> that it's expected:
> He also said that the use case may be better handled by
> high-level library:
> So I send this question to here. Maybe I should send this
> question to Pango. Pango also has the same behavior with
More information about the cairo