shithub: freetype+ttf2subf

Download patch

ref: f33b237c961c41c8bda3fb2dfbc3bc71f9cfabc4
parent: c6788a389d9003c5c6b86f30047e05658416f7d6
author: Michael Zucchi <[email protected]>
date: Mon Jun 8 13:12:40 EDT 2009

Handle FT_STROKER_LINECAP_BUTT.
This fixes Savannah bug #26757.

* src/base/ftstroke.c (ft_stroker_cap): Implement it.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-08  Michael Zucchi  <[email protected]>
+
+	Handle FT_STROKER_LINECAP_BUTT.
+	This fixes Savannah bug #26757.
+
+	* src/base/ftstroke.c (ft_stroker_cap): Implement it.
+
 2009-06-07  Harald Fernengel  <[email protected]>
 
 	Fix some potential out-of-memory crashes.
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -859,6 +859,31 @@
 
       error = ft_stroke_border_lineto( border, &delta, FALSE );
     }
+    else if ( stroker->line_cap == FT_STROKER_LINECAP_BUTT )
+    {
+      /* add a butt ending */
+      FT_Vector        delta;
+      FT_Angle         rotate = FT_SIDE_TO_ROTATE( side );
+      FT_Fixed         radius = stroker->radius;
+      FT_StrokeBorder  border = stroker->borders + side;
+
+
+      FT_Vector_From_Polar( &delta, radius, angle + rotate );
+
+      delta.x += stroker->center.x;
+      delta.y += stroker->center.y;
+
+      error = ft_stroke_border_lineto( border, &delta, FALSE );
+      if ( error )
+        goto Exit;
+
+      FT_Vector_From_Polar( &delta, radius, angle - rotate );
+
+      delta.x += stroker->center.x;
+      delta.y += stroker->center.y;
+
+      error = ft_stroke_border_lineto( border, &delta, FALSE );   
+    }
 
   Exit:
     return error;