freetype
[Top][All Lists]
Advanced

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

Re: [ft] First pretest of FreeType 2.1.10


From: Werner LEMBERG
Subject: Re: [ft] First pretest of FreeType 2.1.10
Date: Fri, 20 May 2005 08:29:47 +0200 (CEST)

> Unfortunately I am seeing various regressions in stroking (which in
> 2.1.9 wasn't perfect, but was better).  I attach some pictures
> comparing 2.1.9 and 2.1.10.  This is FT_STROKER_LINECAP_BUTT /
> FT_STROKER_LINEJOIN_ROUND and VeraMono.ttf.  I can provide more
> detail if needed; similar but lesser regressions are visible in
> FT_STROKER_LINEJOIN_BEVEL.

Below you can find a patch from Chia I Wu <address@hidden> (not
applied yet to the CVS).  Maybe it fixes your problems too.  Please
test.


    Werner


----------------------------------------------------------------------


Index: src/base/ftsynth.c
===================================================================
RCS file: /home/cvs/freetype2/src/base/ftsynth.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ftsynth.c
--- src/base/ftsynth.c  15 May 2005 07:10:28 -0000      1.1.1.1
+++ src/base/ftsynth.c  20 May 2005 05:24:57 -0000
@@ -115,7 +115,9 @@
       {
         FT_Pos     d;
         FT_Vector  in, out;
+#ifdef OLD_ALGORITHM
         FT_Fixed   scale;
+#endif
         FT_Angle   angle_diff;
 
 
@@ -132,6 +134,7 @@
         angle_in   = FT_Atan2( in.x, in.y );
         angle_out  = FT_Atan2( out.x, out.y );
         angle_diff = FT_Angle_Diff( angle_in, angle_out );
+#ifdef OLD_ALGORITHM
         scale      = FT_Cos( angle_diff/2 );
 
         if ( scale < 0x400L && scale > -0x400L )
@@ -148,6 +151,23 @@
 
         outline->points[n].x = v_cur.x + distance + in.x;
         outline->points[n].y = v_cur.y + distance + in.y;
+#else
+       angle_diff = angle_in + angle_diff / 2 - rotate;
+       angle_diff = FT_Angle_Diff( 0, angle_diff );
+
+       d = distance * 2; /* strength */
+
+       if ( -FT_ANGLE_PI2 < angle_diff && angle_diff <= 0 ) {
+               outline->points[n].x = v_cur.x + d;
+       }
+       else if ( 0 < angle_diff && angle_diff < FT_ANGLE_PI2 ) {
+               outline->points[n].x = v_cur.x + d;
+               outline->points[n].y = v_cur.y + d;
+       }
+       else if ( FT_ANGLE_PI2 <= angle_diff && angle_diff < FT_ANGLE_PI ) {
+               outline->points[n].y = v_cur.y + d;
+       }
+#endif
 
         v_prev = v_cur;
         v_cur  = v_next;




reply via email to

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