[Top][All Lists]

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

Re: [Devel] FT_Outline_Get_Orientation is very broken

From: Werner LEMBERG
Subject: Re: [Devel] FT_Outline_Get_Orientation is very broken
Date: Tue, 23 Nov 2004 23:36:27 +0100 (CET)

> While playing with the path stroker, I discovered that
> FT_Outline_Get_Orientation is returning wrong values.  There are
> several obvious problems with the code.  I've attached a patch that
> should fix it.

Thanks.  See below for some comments.

> I haven't checked whether the versions in src/base/ftsynth.c and
> src/autohint/ahglyph.c work.  (But should there really be three
> separate functions that do the same thing?)

The functions are coded very differently.  I don't know whether it is
worth the effort to unify them, but you are invited to contribute code
if it actually makes sense :-)

I ask you to massage the patch a bit:



> -    } while ( prev->x != point->x || prev->y != point->y );
> +    } while ( prev->x == point->x && prev->y == point->y );

It would be nice if you could add some comments, explaining the logic.

> +    return ( FT_Angle_Diff( angle_in, angle_out ) > 1e-5 )

This looks wrong.  FT_Angle_Diff returns values in the FT_Fixed
(16.16) format, so you have to multiply `1e-5' by 2**16.


reply via email to

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