[cairo] OpenType font variations and cairo

Adrian Johnson ajohnson at redneon.com
Tue Sep 19 12:41:50 UTC 2017


On 19/09/17 21:02, Matthias Clasen wrote:
> On Tue, Sep 19, 2017 at 7:04 AM, Adrian Johnson <ajohnson at redneon.com
> <mailto:ajohnson at redneon.com>> wrote:
> 
> 
>     On 18/09/17 01:03, Matthias Clasen wrote:
>     > On Sun, Sep 17, 2017 at 1:12 AM, Adrian Johnson <ajohnson at redneon.com <mailto:ajohnson at redneon.com>
>     > <mailto:ajohnson at redneon.com <mailto:ajohnson at redneon.com>>> wrote:
>     >     I've attached a patch that refactors the float parsing code from
>     >     cff-subset into a new function: _cairo_strtod(). So you can now use this
>     >     for a C locale strtod.
>     >
>     >
>     > Yay, thanks.It might still be nice to apply the strtod_l patch on top,
>     > and only use that code as fallback.
> 
>     -1. Just use the cairo_strtod all the time. We don't use non ANSI C
>     functions with #include guarded fallbacks in cairo. It adds to source
>     code bloat and one side of the #if won't get regularly tested.
> 
> 
> I disagree, at least in this case, but your call.

We don't do it that way in cairo. If the fallback works just use it all
the time.

> 
>     I'm getting a test failure running font-variations. The test log is:
> 
>     axis Weight, value 19660800
>     axis CNTR, value 0
>     Axis Weight: not expected value (19660800 != 13107200)
> 
>     I have tried both the otf and ttf version of the Adobe Variable Font
>     Prototype v1.003. Same result for both.
> 
>     I'm not sure what I'm doing wrong. Could the test be sensitive to my
>     fontconfig configuration? I am using Debian Stretch.
> 
> 
> It sounds unlikely to me. Maybe Behdads fontconfig patches interfere here?
> I've written the test on a system without them.

I did some more testing. With my system fontconfig (2.11) the test
failed (same result) when using the ttf font. FC 2.11 did not recognize
the otf font.

I tested fontconfig 2.12.5. The test crashed with both the ttf and otf
fonts due to a divide by zero error.

What version of FC are you using and which font (otf or ttf)?

Is there some printfs you could add to help debug this?

> 
>     In font-variations.c, FT_Get_Var_Design_Coordinates() will need an
>     #include guard for FreeType >= 2.8.
> 
> 
> 
> 



More information about the cairo mailing list