[cairo] PDF: Font size is rounded
Kouhei Sutou
kou at cozmixng.org
Sat Apr 2 05:00:54 UTC 2016
Hi,
In <56FF4093.5090907 at redneon.com>
"Re: [cairo] PDF: Font size is rounded" on Sat, 2 Apr 2016 14:16:27 +1030,
Adrian Johnson <ajohnson at redneon.com> wrote:
> I put some printfs in _cairo_ft_scaled_glyph_init (in cairo-ft-font.c).
> It appears that FreeType is returning hinted metrics. I'm guessing that
> to get unhinted metrics of TrueType fonts we need to set the scale to
> the EM size like we do for win32 fonts.
>
> I'm attaching a patch to do this. It fixes your test case. I don't know
> if this patch is the correct way to fix the problem. I am not familiar
> with the FreeType font backend.
Thanks for the patch.
I've also confirmed that the patch fix this case.
With the patch:
http://pub.cozmixng.org/~kou/tmp/truetype-size-with-cairo-patch.pdf
Without the patch:
http://pub.cozmixng.org/~kou/tmp/truetype-size-without-cairo-patch.pdf
And explicit CAIRO_HINT_METRICS_OFF isn't needed.
Source:
http://pub.cozmixng.org/~kou/tmp/truetype-size-without-explicit-hint-metrics-off.c
I hope that this patch is included into the next cairo release.
Thanks,
--
kou
More information about the cairo
mailing list