[cairo] PDF: Font size is rounded

Adrian Johnson ajohnson at redneon.com
Sat Jun 18 12:05:59 UTC 2016


I found a problem with my previous patch when testing. I have rewritten
the patch, created a test case, and tested it with the test suite. The
attached patch is the fix I will push out if there are no objections.

A branch including the test case and ref images is at:

https://cgit.freedesktop.org/~ajohnson/cairo/log/?h=unhinted-metrics


On 16/04/16 22:36, Kouhei Sutou wrote:
> 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.
> 
> Could someone who know about the FreeType font backend
> review the patch and commit the patch to the cairo
> repository? I confirmed that the patch fixes the problem I
> reported. I want the next cairo release to include this
> patch.
> 
> 
> Thanks,
> --
> kou
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ft-set-font-size-to-em-size-when-retrieving-unhinted.patch
Type: text/x-patch
Size: 6854 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20160618/14f05a6d/attachment.bin>


More information about the cairo mailing list