shithub: freetype+ttf2subf

Download patch

ref: edbcbde7033e05ce97333af946084d835c833d93
parent: ec810f8c6ac41d2ee20505b00fc8033d098d99a1
author: Werner Lemberg <[email protected]>
date: Thu Aug 22 04:49:42 EDT 2002

Formatting.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,26 +6,36 @@
 
 2002-08-21  David Turner  <[email protected]>
 
-        * src/pshinter/pshalgo3.c, src/autohint/ahangles.c,
-        src/autohint/ahangles.h, src/autohint/ahglyph.c, src/autohint/ahhint.c,
-        src/autohint/ahtypes.h: the automatic and Postscript hinter now
-        automatically detect inflection points in glyph outlines and treats
-        them specially. This is very useful to prevent nasty effect like the
-        disappearing diagonals of "S" and "s" in many, many fonts..
+	The automatic and Postscript hinter now automatically detect
+	inflection points in glyph outlines and treats them specially.  This
+	is very useful to prevent nasty effect like the disappearing
+	diagonals of "S" and "s" in many, many fonts.
 
-        * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
-        src/tools/docmaker/tohtml.py: updating the DocMaker tool
+	* src/autohint/ahtypes.h (ah_flag_inflection): New macro.
+	* src/autohint/ahangles.c (ah_angle_diff): New function.
+	* src/autohint/ahangles.h: Updated.
+	* src/autohint/ahglyph.c (ah_outline_compute_inflections): New
+	function.
+	(ah_outline_detect_features): Use it.
+	* src/autohint/ahhint.c (ah_hinter_align_strong_points)
+	[!AH_OPTION_NO_WEAK_INTERPOLATION]: Handle inflection.
 
-        * include/freetype/freetype.h, src/base/ftobjs.c: changing the type
-        of the "load_flags" parameter of FT_Load_Glyph and FT_Load_Char from
-        "FT_Int" to "FT_Int32", this in order to support more options.
-        
-        this should only break binary and/or source compatibility on
-        16-bit platforms (Atari?)
+	* src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
+	src/tools/docmaker/tohtml.py: Updating the DocMaker tool.
 
-        * src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
-        src/autohint/ahglyph.c, include/freetype/freetype.h: fixing typos
-        and removing compiler warnings
+	* include/freetype/freetype.h: Changing the type of the "load_flags"
+	parameter from "FT_Int" to "FT_Int32", this in order to support more
+	options.  This should only break binary and/or source compatibility
+	on 16-bit platforms (Atari?).
+	(FT_LOAD_NO_AUTOHINT): New macro.
+
+	* src/base/ftobjs.c (FT_Load_Glyph): Updated.
+	Handle FT_LOAD_NO_AUTOHINT.
+	(FT_Load_Char): Updated.
+
+	* src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
+	src/autohint/ahglyph.c, include/freetype/freetype.h: Fixing typos
+	and removing compiler warnings.
 
 2002-08-20  Werner Lemberg  <[email protected]>
 
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1908,9 +1908,9 @@
   /*    *not* the values in `face.glyph.metrics'.                          */
   /*                                                                       */
   FT_EXPORT( FT_Error )
-  FT_Load_Glyph( FT_Face  face,
-                 FT_UInt  glyph_index,
-                 FT_Int32 load_flags );
+  FT_Load_Glyph( FT_Face   face,
+                 FT_UInt   glyph_index,
+                 FT_Int32  load_flags );
 
 
   /*************************************************************************/
@@ -1968,7 +1968,7 @@
   /*    the vector outline being loaded should not be scaled to 26.6       */
   /*    fractional pixels, but kept in notional units.                     */
   /*                                                                       */
-#define FT_LOAD_NO_SCALE  1
+#define FT_LOAD_NO_SCALE  0x1
 
 
   /*************************************************************************/
@@ -1983,7 +1983,7 @@
   /*                                                                       */
   /*    This flag is ignored if FT_LOAD_NO_SCALE is set.                   */
   /*                                                                       */
-#define FT_LOAD_NO_HINTING  2
+#define FT_LOAD_NO_HINTING  0x2
 
 
   /*************************************************************************/
@@ -1999,7 +1999,7 @@
   /*    Note that by default, @FT_Load_Glyph loads the glyph image in its  */
   /*    native format.                                                     */
   /*                                                                       */
-#define FT_LOAD_RENDER  4
+#define FT_LOAD_RENDER  0x4
 
 
   /*************************************************************************/
@@ -2014,7 +2014,7 @@
   /*    bitmaps of scalable formats, as the native glyph image will be     */
   /*    loaded, and can then be rendered through @FT_Render_Glyph.         */
   /*                                                                       */
-#define FT_LOAD_NO_BITMAP  8
+#define FT_LOAD_NO_BITMAP  0x8
 
 
   /*************************************************************************/
@@ -2030,7 +2030,7 @@
   /*    advance width), and that the glyph image will translated to match  */
   /*    the vertical bearings positions.                                   */
   /*                                                                       */
-#define FT_LOAD_VERTICAL_LAYOUT  16
+#define FT_LOAD_VERTICAL_LAYOUT  0x10
 
 
   /*************************************************************************/
@@ -2043,9 +2043,9 @@
   /*    the function should try to auto-hint the glyphs, even if a driver  */
   /*    specific hinter is available.                                      */
   /*                                                                       */
-  /*    Note that it is ignored if @FT_LOAD_NO_AUTOHINT is also set        */
+  /*    Note that it is ignored if @FT_LOAD_NO_AUTOHINT is also set.       */
   /*                                                                       */
-#define FT_LOAD_FORCE_AUTOHINT  32
+#define FT_LOAD_FORCE_AUTOHINT  0x20
 
 
   /*************************************************************************/
@@ -2059,7 +2059,7 @@
   /*    space around its black bits) when loading it.  For now, this       */
   /*    really only works with embedded bitmaps in TrueType fonts.         */
   /*                                                                       */
-#define FT_LOAD_CROP_BITMAP  64
+#define FT_LOAD_CROP_BITMAP  0x40
 
 
   /*************************************************************************/
@@ -2075,7 +2075,7 @@
   /*    error.  Otherwise, errors are ignored by the loader, sometimes     */
   /*    resulting in ugly glyphs.                                          */
   /*                                                                       */
-#define FT_LOAD_PEDANTIC  128
+#define FT_LOAD_PEDANTIC  0x80
 
 
   /*************************************************************************/
@@ -2090,7 +2090,7 @@
   /*    X-TrueType font server, in order to deal correctly with the        */
   /*    incorrect metrics contained in DynaLab's TrueType CJK fonts.       */
   /*                                                                       */
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  512
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  0x200
 
 
   /*************************************************************************/
@@ -2111,7 +2111,7 @@
   /*                                                                       */
   /*    Note that the flag forces the load of unscaled glyphs.             */
   /*                                                                       */
-#define FT_LOAD_NO_RECURSE  1024
+#define FT_LOAD_NO_RECURSE  0x400
 
 
   /*************************************************************************/
@@ -2124,7 +2124,7 @@
   /*    the glyph loader should not try to transform the loaded glyph      */
   /*    image.                                                             */
   /*                                                                       */
-#define FT_LOAD_IGNORE_TRANSFORM  2048
+#define FT_LOAD_IGNORE_TRANSFORM  0x800
 
 
   /*************************************************************************/
@@ -2138,7 +2138,7 @@
   /*    glyph loader to use `ft_render_mode_mono' when calling             */
   /*    @FT_Render_Glyph.                                                  */
   /*                                                                       */
-#define FT_LOAD_MONOCHROME  4096
+#define FT_LOAD_MONOCHROME  0x1000
 
 
   /*************************************************************************/
@@ -2151,11 +2151,13 @@
   /*    the function should return the linearly scaled metrics expressed   */
   /*    in original font units, instead of the default 16.16 pixel values. */
   /*                                                                       */
-#define FT_LOAD_LINEAR_DESIGN  8192
+#define FT_LOAD_LINEAR_DESIGN  0x2000
 
+
   /* temporary hack! */
-#define FT_LOAD_SBITS_ONLY  16384
+#define FT_LOAD_SBITS_ONLY  0x4000
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Constant>                                                            */
@@ -2163,20 +2165,21 @@
   /*                                                                       */
   /* <Description>                                                         */
   /*    A bit field constant, used with @FT_Load_Glyph to indicate that    */
-  /*    the auto-hinter should never be run. This can be important for     */
+  /*    the auto-hinter should never be run.  This can be important for    */
   /*    certain fonts where un-hinted output is better than auto-hinted    */
   /*    one.                                                               */
   /*                                                                       */
   /*    Note that this will _not_ prevent a native hinter to be run        */
   /*    when available (i.e. for Postscript fonts, or for TrueType ones    */
-  /*    when the bytecode interpreter was compiled in)                     */
+  /*    when the bytecode interpreter was compiled in).                    */
   /*                                                                       */
   /*    If you want to completely disable hinting, use @FT_LOAD_NO_HINTING */
   /*    instead.                                                           */
   /*                                                                       */
-  /*    The @FT_LOAD_FORCE_AUTOHINT flag will not work if this flag is set */
+  /*    The @FT_LOAD_FORCE_AUTOHINT flag will not work if this flag is     */
+  /*    set.                                                               */
   /*                                                                       */
-#define FT_LOAD_NO_AUTOHINT  32768
+#define FT_LOAD_NO_AUTOHINT  0x8000U
 
 
   /*************************************************************************/
@@ -2190,7 +2193,7 @@
   /*    embedded bitmaps are favored over outlines, vectors are always     */
   /*    scaled and grid-fitted.                                            */
   /*                                                                       */
-#define FT_LOAD_DEFAULT  0
+#define FT_LOAD_DEFAULT  0x0
 
 
   /*************************************************************************/
--- a/src/autohint/ahangles.c
+++ b/src/autohint/ahangles.c
@@ -133,6 +133,7 @@
   {
     AH_Angle  delta;
     
+
     delta = ( angle2 - angle1 );
     if ( delta < 0 )
       delta += AH_2PI;
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -674,13 +674,15 @@
     }
   }
 
- /* compute all inflex points in a given glyph */
+
+  /* compute all inflex points in a given glyph */
   static void
   ah_outline_compute_inflections( AH_Outline*  outline )
   {
-    AH_Point**   contour       =  outline->contours;
-    AH_Point**   contour_limit =  contour + outline->num_contours;
+    AH_Point**  contour       =  outline->contours;
+    AH_Point**  contour_limit =  contour + outline->num_contours;
 
+
     /* load original coordinates in (u,v) */
     ah_setup_uv( outline, ah_uv_fxy );
 
@@ -698,8 +700,9 @@
       AH_Angle   diff_in, diff_out;
       FT_Int     finished = 0;
 
+
       /* compute first segment in contour */
-      first  = point;
+      first = point;
 
       start = end = first;
       do
@@ -707,9 +710,9 @@
         end = end->next;
         if ( end == first )
           goto Skip;
-      }
-      while ( end->u == first->u && end->v == first->v );
 
+      } while ( end->u == first->u && end->v == first->v );
+
       vec.x = end->u - start->u;
       vec.y = end->v - start->v;
       angle_seg = ah_angle( &vec );
@@ -724,15 +727,15 @@
           before = before->prev;
           if ( before == first )
             goto Skip;
-        }
-        while ( before->u == start->u && before->v == start->v );
 
+        } while ( before->u == start->u && before->v == start->v );
+
         vec.x    = start->u - before->u;
         vec.y    = start->v - before->v;
         angle_in = ah_angle( &vec );
-      }
-      while ( angle_in == angle_seg );
 
+      } while ( angle_in == angle_seg );
+
       first   = start;
       diff_in = ah_angle_diff( angle_in, angle_seg );
 
@@ -749,15 +752,15 @@
             after = after->next;
             if ( after == first )
               finished = 1;
-          }
-          while ( end->u == after->u && end->v == after->v );
 
+          } while ( end->u == after->u && end->v == after->v );
+
           vec.x     = after->u - end->u;
           vec.y     = after->v - end->v;
           angle_out = ah_angle( &vec );
-        }
-        while ( angle_out == angle_seg );
 
+        } while ( angle_out == angle_seg );
+
         diff_out = ah_angle_diff( angle_seg, angle_out );
 
         if ( ( diff_in ^ diff_out ) < 0 )
@@ -769,9 +772,9 @@
           {
             start->flags |= ah_flag_inflection;
             start = start->next;
-          }
-          while ( start != end );
 
+          } while ( start != end );
+
           start->flags |= ah_flag_inflection;
         }
 
@@ -779,9 +782,9 @@
         end       = after;
         angle_seg = angle_out;
         diff_in   = diff_out;
-      }
-      while ( !finished );
 
+      } while ( !finished );
+
     Skip:
       ;
     }
@@ -788,7 +791,6 @@
   }
 
 
-
   FT_LOCAL_DEF( void )
   ah_outline_compute_segments( AH_Outline*  outline )
   {
@@ -1401,9 +1403,9 @@
   FT_LOCAL_DEF( void )
   ah_outline_detect_features( AH_Outline*  outline )
   {
-    ah_outline_compute_segments( outline );
-    ah_outline_link_segments   ( outline );
-    ah_outline_compute_edges   ( outline );
+    ah_outline_compute_segments   ( outline );
+    ah_outline_link_segments      ( outline );
+    ah_outline_compute_edges      ( outline );
     ah_outline_compute_inflections( outline );
   }
 
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -612,8 +612,8 @@
 #ifndef AH_OPTION_NO_WEAK_INTERPOLATION
           /* if this point is candidate to weak interpolation, we will  */
           /* interpolate it after all strong points have been processed */
-          if (  (point->flags & ah_flag_weak_interpolation) &&
-               !(point->flags & ah_flag_inflection)         )
+          if (  ( point->flags & ah_flag_weak_interpolation ) &&
+               !( point->flags & ah_flag_inflection )         )
             continue;
 #endif
 
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -1438,7 +1438,7 @@
             continue;
 
           if ( !psh3_point_is_extremum( point )   &&
-               !psh3_point_is_inflection( point ) )
+               !psh3_point_is_inflex( point ) )
             continue;
 
           point->flags &= ~PSH3_POINT_SMOOTH;