shithub: freetype+ttf2subf

Download patch

ref: f68cfd096f210890422417a08e8c8b1799b4146a
parent: 6a6e6f27acc4f238b12c1211ec92c50a079c1f46
author: Werner Lemberg <[email protected]>
date: Wed Jul 14 17:30:34 EDT 2004

* src/base/ftstroke (ft_stroke_border_reverse): Removed.  Unused.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,33 @@
+2004-07-13  Werner Lemberg  <[email protected]>
+
+	* src/base/ftstroke (ft_stroke_border_reverse): Removed.  Unused.
+
 2004-07-12  David Turner  <[email protected]>
 
-        * src/base/ftstroke.c: last (?) bugfixes to the stroker.
+	* src/base/ftstroke.c (ft_stroke_border_close): Add second parameter
+	to indicate reversion of points.
+	Update all callers.
+	(ft_stroke_border_reverse): Fix initialization of `point1' and
+	`tag1'.
 
-        * src/cache/ftcsbits.c: fixing advance computation for
-        transformed glyphs
+	* src/cache/ftcsbits.c (ftc_snode_load): Fixing advance computation
+	for transformed glyphs.
         
 2004-07-11  David Turner  <[email protected]>
 
-        * src/base/ftstroke.c: fixed a bug that prevented the stroker to
-        correctly generate stroked paths from closed paths, i.e. nearly
-        all glyphs in vectorial fonts :-)
+	Fix bugs that prevented the stroker to correctly generate stroked
+	paths from closed paths, i.e., nearly all glyphs in vectorial fonts.
 
-        The code is still _very_ buggy though, treat with special care.
+	The code is still _very_ buggy though; treat with special care.
 
+	* src/base/ftstroke.c (FT_STROKE_TAG_BEGIN_END): New macro.
+	(ft_stroke_border_reverse): New function.
+	(ft_stroker_inside): Remove local variable `sigma'; use different
+	threshold.
+	(ft_stroker_add_reverse_left): Switch begin/end tags if necessary.
+	(FT_Stroker_EndSubPath): Call ft_stroker_inside and
+	ft_stroke_border_reverse.
+
 2004-06-26  Peter Kovar  <[email protected]>
 
 	* src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
@@ -24,8 +39,8 @@
 
 2004-06-24  David Turner  <[email protected]>
 
-        * src/truetype/ttgload.c, src/truetype/ttxgvar.c: removing
-        compiler warnings
+	* src/truetype/ttgload.c, src/truetype/ttxgvar.c: Removing
+	compiler warnings.
 
 2004-06-23  Werner Lemberg  <[email protected]>
 
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -286,6 +286,7 @@
     FT_UInt  start = border->start;
     FT_UInt  count = border->num_points;
 
+
     FT_ASSERT( border->start >= 0 );
 
     /* don't record empty paths! */
@@ -293,24 +294,24 @@
       border->num_points = start;
     else
     {
-     /* copy the last point to the start of this sub-path, since
-      * it contains the "adjusted" starting coordinates
-      */
+      /* copy the last point to the start of this sub-path, since */
+      /* it contains the `adjusted' starting coordinates          */
       border->num_points    = --count;
       border->points[start] = border->points[count];
 
       if ( reverse )
       {
-       /* reverse the points
-        */
+        /* reverse the points */
         {
           FT_Vector*  vec1 = border->points + start + 1;
           FT_Vector*  vec2 = border->points + count - 1;
 
+
           for ( ; vec1 < vec2; vec1++, vec2-- )
           {
             FT_Vector  tmp;
 
+
             tmp   = *vec1;
             *vec1 = *vec2;
             *vec2 = tmp;
@@ -317,16 +318,17 @@
           }
         }
 
-       /* then the tags
-        */
+        /* then the tags */
         {
           FT_Byte*  tag1 = border->tags + start + 1;
           FT_Byte*  tag2 = border->tags + count - 1;
 
+
           for ( ; tag1 < tag2; tag1++, tag2-- )
           {
             FT_Byte  tmp;
 
+
             tmp   = *tag1;
             *tag1 = *tag2;
             *tag2 = tmp;
@@ -334,8 +336,8 @@
         }
       }
 
-      border->tags[ start     ] |= FT_STROKE_TAG_BEGIN;
-      border->tags[ count - 1 ] |= FT_STROKE_TAG_END;
+      border->tags[start    ] |= FT_STROKE_TAG_BEGIN;
+      border->tags[count - 1] |= FT_STROKE_TAG_END;
     }
 
     border->start   = -1;
@@ -674,54 +676,6 @@
   }
 
 
-  static void
-  ft_stroke_border_reverse( FT_StrokeBorder  border )
-  {
-    FT_Vector*  point1 = border->points + border->start + 1;
-    FT_Vector*  point2 = border->points + border->num_points-1;
-    FT_Byte*    tag1   = border->tags + border->start + 1;
-    FT_Byte*    tag2   = border->tags + border->num_points-1;
-
-    while ( point1 < point2 )
-    {
-      FT_Vector  tpoint;
-      FT_Byte    ttag1, ttag2, ttag;
-
-     /* swap the points
-      */
-      tpoint  = *point1;
-      *point1 = *point2;
-      *point2 = tpoint;
-
-     /* swap the tags
-      */
-      ttag1 = *tag1;
-      ttag2 = *tag2;
-
-#if 0
-      ttag = ttag1 & FT_STROKE_TAG_BEGIN_END;
-      if ( ttag == FT_STROKE_TAG_BEGIN ||
-           ttag == FT_STROKE_TAG_END   )
-        ttag1 ^= FT_STROKE_TAG_BEGIN_END;
-
-      ttag = ttag2 & FT_STROKE_TAG_BEGIN_END;
-      if ( ttag == FT_STROKE_TAG_BEGIN ||
-           ttag == FT_STROKE_TAG_END   )
-        ttag2 ^= FT_STROKE_TAG_BEGIN_END;
-#endif
-
-      *tag1 = ttag2;
-      *tag2 = ttag1;
-
-      point1++;
-      point2--;
-      tag1++;
-      tag2--;
-    }
-  }
-
-
-
  /***************************************************************************/
  /***************************************************************************/
  /*****                                                                 *****/
@@ -919,8 +873,7 @@
 
     thcos  = FT_Cos( theta );
 
-   /* TODO: find better criterion to switch off the optimisation
-    */
+    /* TODO: find better criterion to switch off the optimization */
     if ( thcos < 0x4000 )
     {
       FT_Vector_From_Polar( &delta, stroker->radius,
@@ -1453,12 +1406,11 @@
           {
             FT_Byte  ttag = dst_tag[0] & FT_STROKE_TAG_BEGIN_END;
 
-            /* switch begin/end tags if necessary.. */
+
+            /* switch begin/end tags if necessary */
             if ( ttag == FT_STROKE_TAG_BEGIN ||
                  ttag == FT_STROKE_TAG_END   )
-            {
               dst_tag[0] ^= FT_STROKE_TAG_BEGIN_END;
-            }
 
           }