> I have created the demo program, it can be used to view raw SDF
> without any bilinear filtering and there is no way to reconstruct
> fonts from SDF because again it doesn't have bilinear filtering.  I
> will add that soon.

Thanks, will test soon.

> There is a pretty weird issue that I ran into while testing the demo
> on linux which doesn't happen on windows whatsoever. On linux
> various computations give wrong output.  For example, division of
> -328032 by 64 gives 1811934202, whereas it should be -5125.
> Moreover FT_Vector_Length returns negative values even for small
> vectors.  There is no overflow so what am I doing wrong?  (One of
> the places it happens is:
> https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/sdf/ftsdf.c?h=anuj-distance-field#n1129
> where the `factor' is wrong after division with 64).

I'm not aware of arithmetic computation problems within FreeType.

Maybe you are experiencing a 32bit vs. 64bit issue?  It might also
help to compile with UBSan to enable run-time checking of over- and
underflow.  As an additional step, you could try to compile with clang
instead of gcc.


    Werner

Reply via email to