shithub: freetype+ttf2subf

Download patch

ref: 34d61e8637f29b05fccae5464fa4414e62627b8e
parent: 463dddadfbc4a5d28b7983c69ddd840b72519325
author: Werner Lemberg <[email protected]>
date: Fri Oct 15 16:44:15 EDT 2010

Fix thinko in spline flattening.

FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL.

* src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and
replace it everywhere with ONE_PIXEL/8.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-10-15  Alexei Podtelezhnikov  <[email protected]>
+
+	Fix thinko in spline flattening.
+
+	FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL.
+
+	* src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and
+	replace it everywhere with ONE_PIXEL/8.
+
 2010-10-13  suzuki toshiya  <[email protected]>
 
 	[raccess] Skip unrequired resource access rules by Darwin VFS.
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -91,11 +91,6 @@
 #define FT_COMPONENT  trace_smooth
 
 
-  /* The maximum distance of a curve from the chord, in 64ths of a pixel; */
-  /* used when flattening curves.                                         */
-#define FT_MAX_CURVE_DEVIATION  16
-
-
 #ifdef _STANDALONE_
 
 
@@ -891,7 +886,7 @@
     if ( dx < dy )
       dx = dy;
 
-    if ( dx <= FT_MAX_CURVE_DEVIATION )
+    if ( dx <= ONE_PIXEL / 8 )
     {
       gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
       return;
@@ -898,7 +893,7 @@
     }
 
     level = 1;
-    dx /= FT_MAX_CURVE_DEVIATION;
+    dx /= ONE_PIXEL / 8;
     while ( dx > 1 )
     {
       dx >>= 2;
@@ -1074,7 +1069,7 @@
           goto Split;
 
         /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */
-        s_limit = L * (TPos)( FT_MAX_CURVE_DEVIATION / 0.75 );
+        s_limit = L * (TPos)( ONE_PIXEL / 6 );
 
         /* s is L * the perpendicular distance from P1 to the line P0-P3. */
         dx1 = arc[1].x - arc[0].x;