freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] problems with too high BlueScale values in CFF font


From: Werner LEMBERG
Subject: Re: [ft-devel] problems with too high BlueScale values in CFF font
Date: Sat, 06 Oct 2012 13:34:48 +0200 (CEST)

Hello Bram!


> 2) cut off too large values to the maximum of 16.16 when parsing

This is the solution I prefer.

>    - no changes for files that are within the allowed range for
>      16.16
>    - result might still not be correct (just consistent between
>      32/64 bit)
>    - one of the first operations that's done in the check with
>      blue_scale is multiplying it by a factor, this will have to be
>      reworked as well.

I suggest to replace a too large BlueScale value with the greatest
value possible to represent.  The value `48' certainly looks like an
error, and it has zero practical effect.

> As a separate item, it would be nice if FT_Fixed, FT_F26Dot6 and
> FT_F2Dot14 could be updated to be exactly 32 (resp 16) bits large so
> that there will be less differences between processing a file in 32
> and 64 bit.

Yes, this would be good, and...

> I already tried this quickly locally using FT_Int32/FT_Int16 instead
> of FT_Long/FT_Short.  However FT internally doesn't have a clear
> distinction between FT_Long and FT_Fixed and casts some FT_Long
> arrays to FT_Fixed arrays and vice versa.

this should certainly be fixed, if possible.  However, ...

> (public api will have to change as well).

this is a no-go, unfortunately.  A forthcoming FreeType 3 (in case
people would like to write something like that :-) might fix this, not
repeating the errors from the past.

> I haven't fully investigated this, but after doing these changes I
> get memory corruptions when running.

Thanks for checking!


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]