shithub: freetype+ttf2subf

Download patch

ref: 110fc56beadee6a9414edff34222a54555b3a490
parent: c6f1c1022253fe6517f978a1fe881712ee95476b
author: Werner Lemberg <[email protected]>
date: Sat May 3 16:13:48 EDT 2003

* src/autohint/ahoptim.c (LOG): Renamed to...
(AH_OPTIM_LOG): This.
(AH_Dump_Springs): Fix log message format.

* src/autohint/ahhint.c (ah_hint_edges_3): Renamed to...
(ah_hint_edges): This.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-02  Werner Lemberg  <[email protected]>
+
+	* src/autohint/ahoptim.c (LOG): Renamed to...
+	(AH_OPTIM_LOG): This.
+	(AH_Dump_Springs): Fix log message format.
+
+	* src/autohint/ahhint.c (ah_hint_edges_3): Renamed to...
+	(ah_hint_edges): This.
+
 2002-05-02  Keith Packard  <[email protected]>
 
 	* src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Initialize `max_advance'.
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -27,11 +27,12 @@
 #include FT_OUTLINE_H
 
 
-#define FACE_GLOBALS( face )  ((AH_Face_Globals)(face)->autohint.data)
+#define FACE_GLOBALS( face )  ( (AH_Face_Globals)(face)->autohint.data )
 
 #define AH_USE_IUP
 #define OPTIM_STEM_SNAP
 
+
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
@@ -70,7 +71,7 @@
       }
     }
 
-    scaled = (reference+32) & -64;
+    scaled = ( reference + 32 ) & -64;
 
     if ( width >= reference )
     {
@@ -116,7 +117,7 @@
     else if ( (  vertical && !hinter->do_vert_snapping ) ||
               ( !vertical && !hinter->do_horz_snapping ) )
     {
-      /* smooth hinting process, very lightly quantize the stem width */
+      /* smooth hinting process: very lightly quantize the stem width */
       /*                                                              */
 
       /* leave the widths of serifs alone */
@@ -150,8 +151,8 @@
 
         if ( dist < 3 * 64 )
         {
-          delta = ( dist & 63 );
-          dist &= -64;
+          delta  = dist & 63;
+          dist  &= -64;
 
           if ( delta < 10 )
             dist += delta;
@@ -171,7 +172,7 @@
     }
     else
     {
-      /* strong hinting process, snap the stem width to integer pixels */
+      /* strong hinting process: snap the stem width to integer pixels */
       /*                                                               */
       if ( vertical )
       {
@@ -186,7 +187,7 @@
       }
       else
       {
-        dist = ah_snap_width( globals->widths,  globals->num_widths, dist );
+        dist = ah_snap_width( globals->widths, globals->num_widths, dist );
 
         if ( hinter->flags & AH_HINTER_MONOCHROME )
         {
@@ -208,7 +209,7 @@
           else if ( dist < 128 )
             dist = ( dist + 22 ) & -64;
           else
-            /* XXX: round otherwise, prevent color fringes in LCD mode */
+            /* XXX: round otherwise to prevent color fringes in LCD mode */
             dist = ( dist + 32 ) & -64;
         }
       }
@@ -246,7 +247,7 @@
     else if ( (  vertical && !hinter->do_vert_snapping ) ||
               ( !vertical && !hinter->do_horz_snapping ) )
     {
-      /* smooth hinting process, very lightly quantize the stem width */
+      /* smooth hinting process: very lightly quantize the stem width */
       /*                                                              */
       if ( dist < 64 )
         dist = 64;
@@ -267,8 +268,8 @@
 
         if ( dist < 3 * 64 )
         {
-          delta = ( dist & 63 );
-          dist &= -64;
+          delta  = dist & 63;
+          dist  &= -64;
 
           if ( delta < 10 )
             dist += delta;
@@ -288,7 +289,7 @@
     }
     else
     {
-      /* strong hinting process, snap the stem width to integer pixels */
+      /* strong hinting process: snap the stem width to integer pixels */
       /*                                                               */
       if ( vertical )
       {
@@ -303,7 +304,7 @@
       }
       else
       {
-        dist = ah_snap_width( globals->widths,  globals->num_widths, dist );
+        dist = ah_snap_width( globals->widths, globals->num_widths, dist );
 
         if ( hinter->flags & AH_HINTER_MONOCHROME )
         {
@@ -325,7 +326,7 @@
           else if ( dist < 128 )
             dist = ( dist + 22 ) & -64;
           else
-            /* XXX: round otherwise, prevent color fringes in LCD mode */
+            /* XXX: round otherwise to prevent color fringes in LCD mode */
             dist = ( dist + 32 ) & -64;
         }
       }
@@ -357,6 +358,7 @@
                                                   base_edge->flags,
                                                   stem_edge->flags );
 
+
     stem_edge->pos = base_edge->pos + fitted_width;
 
 #else
@@ -381,6 +383,7 @@
     FT_UNUSED( hinter );
     FT_UNUSED( vertical );
 
+
     dist = serif->opos - base->opos;
     if ( dist < 0 )
     {
@@ -388,15 +391,16 @@
       sign = -1;
     }
 
-    /* do not touch serifs widths !! */
 #if 0
+    /* do not touch serifs widths! */
     if ( base->flags & AH_EDGE_DONE )
     {
       if ( dist >= 64 )
-        dist = (dist+8) & -64;
+        dist = ( dist + 8 ) & -64;
 
       else if ( dist <= 32 && !vertical )
         dist = ( dist + 33 ) >> 1;
+
       else
         dist = 0;
     }
@@ -417,9 +421,8 @@
   /*************************************************************************/
 
 
-  /* Another alternative edge hinting algorithm */
   static void
-  ah_hint_edges_3( AH_Hinter  hinter )
+  ah_hint_edges( AH_Hinter  hinter )
   {
     AH_Edge     edges;
     AH_Edge     edge_limit;
@@ -464,7 +467,7 @@
           {
             edge1 = edge;
           }
-          else if (edge2 && edge2->blue_edge)
+          else if ( edge2 && edge2->blue_edge )
           {
             blue  = edge2->blue_edge;
             edge1 = edge2;
@@ -488,8 +491,8 @@
         }
       }
 
-      /* now, we will align all stem edges, trying to maintain the */
-      /* relative order of stems in the glyph..                    */
+      /* now we will align all stem edges, trying to maintain the */
+      /* relative order of stems in the glyph                     */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         AH_EdgeRec*  edge2;
@@ -506,12 +509,11 @@
           continue;
         }
 
-        /* now, align the stem */
+        /* now align the stem */
 
-        /* this should not happen, but it's better to be safe. */
+        /* this should not happen, but it's better to be safe */
         if ( edge2->blue_edge || edge2 < edge )
         {
-
           ah_align_linked_edge( hinter, edge2, edge, dimension );
           edge->flags |= AH_EDGE_DONE;
           continue;
@@ -522,14 +524,15 @@
 
 #ifdef FT_CONFIG_CHESTER_STEM
 
-          FT_Pos   org_len, org_center, cur_len;
-          FT_Pos   cur_pos1, error1, error2, u_off, d_off;
+          FT_Pos  org_len, org_center, cur_len;
+          FT_Pos  cur_pos1, error1, error2, u_off, d_off;
 
-          org_len    = edge2->opos - edge->opos;
-          cur_len    = ah_compute_stem_width( hinter, dimension, org_len,
-                                              edge->flags, edge2->flags   );
 
-          if (cur_len <= 64 )
+          org_len = edge2->opos - edge->opos;
+          cur_len = ah_compute_stem_width( hinter, dimension, org_len,
+                                           edge->flags, edge2->flags );
+
+          if ( cur_len <= 64 )
             u_off = d_off = 32;
           else
           {
@@ -563,7 +566,7 @@
           else
             edge->pos = ( edge->opos + 32 ) & -64;
 
-          anchor    = edge;
+          anchor = edge;
 
           edge->flags |= AH_EDGE_DONE;
 
@@ -583,23 +586,23 @@
         }
         else
         {
-          FT_Pos   org_pos, org_len, org_center, cur_len;
-          FT_Pos   cur_pos1, cur_pos2, delta1, delta2;
+          FT_Pos  org_pos, org_len, org_center, cur_len;
+          FT_Pos  cur_pos1, cur_pos2, delta1, delta2;
 
 
-          org_pos    = anchor->pos + (edge->opos - anchor->opos);
+          org_pos    = anchor->pos + ( edge->opos - anchor->opos );
           org_len    = edge2->opos - edge->opos;
           org_center = org_pos + ( org_len >> 1 );
 
 #ifdef FT_CONFIG_CHESTER_SERIF
 
-          cur_len    = ah_compute_stem_width( hinter, dimension, org_len,
-                                              edge->flags, edge2->flags  );
+          cur_len = ah_compute_stem_width( hinter, dimension, org_len,
+                                           edge->flags, edge2->flags  );
 
 
 #else  /* !FT_CONFIG_CHESTER_SERIF */
 
-          cur_len    = ah_compute_stem_width( hinter, dimension, org_len );
+          cur_len = ah_compute_stem_width( hinter, dimension, org_len );
 
 #endif /* !FT_CONFIG_CHESTER_SERIF */
 
@@ -610,7 +613,7 @@
             FT_Pos  u_off, d_off;
 
 
-            cur_pos1   = ( org_center + 32 ) & -64;
+            cur_pos1 = ( org_center + 32 ) & -64;
 
             if (cur_len <= 64 )
               u_off = d_off = 32;
@@ -620,11 +623,11 @@
               d_off = 26;
             }
 
-            delta1 = org_center - (cur_pos1 - u_off);
+            delta1 = org_center - ( cur_pos1 - u_off );
             if ( delta1 < 0 )
               delta1 = -delta1;
 
-            delta2 = org_center - (cur_pos1 + d_off);
+            delta2 = org_center - ( cur_pos1 + d_off );
             if ( delta2 < 0 )
               delta2 = -delta2;
 
@@ -638,8 +641,7 @@
           }
           else
           {
-
-            org_pos    = anchor->pos + (edge->opos - anchor->opos);
+            org_pos    = anchor->pos + ( edge->opos - anchor->opos );
             org_len    = edge2->opos - edge->opos;
             org_center = org_pos + ( org_len >> 1 );
 
@@ -688,8 +690,8 @@
       if ( !has_serifs )
         goto Next_Dimension;
 
-      /* now, hint the remaining edges (serifs and single) in order */
-      /* to complete our processing                                 */
+      /* now hint the remaining edges (serifs and single) in order */
+      /* to complete our processing                                */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         if ( edge->flags & AH_EDGE_DONE )
@@ -731,7 +733,7 @@
     /* reduce the problem of the disappearing eye in the `e' of Times... */
     /* also, creates some artifacts near the blue zones?                 */
     {
-      ah_hint_edges_3( hinter );
+      ah_hint_edges( hinter );
     }
   }
 
@@ -807,6 +809,7 @@
 
 
   /* hint the strong points -- this is equivalent to the TrueType `IP' */
+  /* hinting instruction                                               */
   static void
   ah_hinter_align_strong_points( AH_Hinter  hinter )
   {
@@ -872,7 +875,7 @@
             goto Store_Point;
           }
 
-          /* is the point after the last edge ? */
+          /* is the point after the last edge? */
           edge  = edge_limit - 1;
           delta = u - edge->fpos;
           if ( delta >= 0 )
@@ -1023,6 +1026,7 @@
 
 
   /* interpolate weak points -- this is equivalent to the TrueType `IUP' */
+  /* hinting instruction                                                 */
   static void
   ah_hinter_align_weak_points( AH_Hinter  hinter )
   {
@@ -1163,8 +1167,8 @@
   {
     FT_Int           n;
     AH_Face_Globals  globals = hinter->globals;
-    AH_Globals       design = &globals->design;
-    AH_Globals       scaled = &globals->scaled;
+    AH_Globals       design  = &globals->design;
+    AH_Globals       scaled  = &globals->scaled;
 
 
     /* copy content */
@@ -1233,7 +1237,7 @@
       ah_outline_done( hinter->glyph );
 
       /* note: the `globals' pointer is _not_ owned by the hinter */
-      /*       but by the current face object, we don't need to   */
+      /*       but by the current face object; we don't need to   */
       /*       release it                                         */
       hinter->globals = 0;
       hinter->face    = 0;
@@ -1382,8 +1386,8 @@
         }
       }
 
-      /* copy the outline points in the loader's current                */
-      /* extra points, which is used to keep original glyph coordinates */
+      /* copy the outline points in the loader's current               */
+      /* extra points which is used to keep original glyph coordinates */
       error = ah_loader_check_points( gloader, slot->outline.n_points + 2,
                                       slot->outline.n_contours );
       if ( error )
@@ -1411,8 +1415,8 @@
       if ( slot->outline.n_points == 0 )
         goto Hint_Metrics;
 
-      /* now, load the slot image into the auto-outline, and run the */
-      /* automatic hinting process                                   */
+      /* now load the slot image into the auto-outline and run the */
+      /* automatic hinting process                                 */
       error = ah_outline_load( outline, x_scale, y_scale, face );
       if ( error )
         goto Exit;
@@ -1560,7 +1564,7 @@
 
             l += num_base_points;
 
-            /* for now, only use the current point coordinates     */
+            /* for now, only use the current point coordinates;    */
             /* we may consider another approach in the near future */
             p1 = gloader->base.outline.points + start_point + k;
             p2 = gloader->base.outline.points + start_point + l;
@@ -1605,8 +1609,8 @@
       if ( hinter->transformed )
         FT_Outline_Transform( &gloader->base.outline, &hinter->trans_matrix );
 
-      /* we must translate our final outline by -pp1.x, and compute */
-      /* the new metrics                                            */
+      /* we must translate our final outline by -pp1.x and compute */
+      /* the new metrics                                           */
       if ( hinter->pp1.x )
         FT_Outline_Translate( &gloader->base.outline, -hinter->pp1.x, 0 );
 
@@ -1621,8 +1625,8 @@
       slot->metrics.horiBearingX = bbox.xMin;
       slot->metrics.horiBearingY = bbox.yMax;
 
-      /* for mono-width fonts (like Andale, Courier, etc.), we need */
-      /* to keep the original rounded advance width                 */
+      /* for mono-width fonts (like Andale, Courier, etc.) we need */
+      /* to keep the original rounded advance width                */
       if ( !FT_IS_FIXED_WIDTH( slot->face ) )
         slot->metrics.horiAdvance = hinter->pp2.x - hinter->pp1.x;
       else
@@ -1663,7 +1667,7 @@
     FT_Fixed         x_scale      = size->metrics.x_scale;
     FT_Fixed         y_scale      = size->metrics.y_scale;
     AH_Face_Globals  face_globals = FACE_GLOBALS( face );
-    FT_Render_Mode   hint_mode    = FT_LOAD_TARGET_MODE(load_flags);
+    FT_Render_Mode   hint_mode    = FT_LOAD_TARGET_MODE( load_flags );
 
 
     /* first of all, we need to check that we're using the correct face and */
--- a/src/autohint/ahoptim.c
+++ b/src/autohint/ahoptim.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType auto hinting outline optimization (body).                   */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002 Catharon Productions Inc.                    */
+/*  Copyright 2000-2001, 2002, 2003 Catharon Productions Inc.              */
 /*  Author: David Turner                                                   */
 /*                                                                         */
 /*  This file is part of the Catharon Typography Project and shall only    */
@@ -21,9 +21,9 @@
 
   /*************************************************************************/
   /*                                                                       */
-  /* This module is in charge of optimising the outlines produced by the   */
+  /* This module is in charge of optimizing the outlines produced by the   */
   /* auto-hinter in direct mode. This is required at small pixel sizes in  */
-  /* order to ensure coherent spacing, among other things..                */
+  /* order to ensure coherent spacing, among other things.                 */
   /*                                                                       */
   /* The technique used in this module is a simplified simulated           */
   /* annealing.                                                            */
@@ -42,17 +42,17 @@
 #define AH_BRUTE_FORCE
 
 
-#define xxxAH_DEBUG_OPTIM
+#define xxAH_DEBUG_OPTIM
 
 
-#undef LOG
+#undef AH_OPTIM_LOG
 #ifdef AH_DEBUG_OPTIM
 
-#define LOG( x )  optim_log ## x
+#define AH_OPTIM_LOG( x )  optim_log ## x
 
 #else
 
-#define LOG( x )
+#define AH_OPTIM_LOG( x )  do ; while ( 0 ) /* nothing */
 
 #endif /* AH_DEBUG_OPTIM */
 
@@ -87,13 +87,13 @@
     stem = optimizer->stems;
     for ( n = 0; n < optimizer->num_stems; n++, stem++ )
     {
-      LOG(( " %c%2d [%.1f:%.1f]={%.1f:%.1f}="
-            "<%1.f..%1.f> force=%.1f speed=%.1f\n",
-            optimizer->vertical ? 'V' : 'H', n,
-            FLOAT( stem->edge1->opos ), FLOAT( stem->edge2->opos ),
-            FLOAT( stem->edge1->pos ),  FLOAT( stem->edge2->pos ),
-            FLOAT( stem->min_pos ),     FLOAT( stem->max_pos ),
-            FLOAT( stem->force ),       FLOAT( stem->velocity ) ));
+      AH_OPTIM_LOG(( " %c%2d [%.1f:%.1f]={%.1f:%.1f}="
+                     "<%1.f..%1.f> force=%.1f speed=%.1f\n",
+                     optimizer->vertical ? 'V' : 'H', n,
+                     FLOAT( stem->edge1->opos ), FLOAT( stem->edge2->opos ),
+                     FLOAT( stem->edge1->pos ),  FLOAT( stem->edge2->pos ),
+                     FLOAT( stem->min_pos ),     FLOAT( stem->max_pos ),
+                     FLOAT( stem->force ),       FLOAT( stem->velocity ) ));
     }
   }
 
@@ -108,11 +108,11 @@
     stem = optimizer->stems;
     for ( n = 0; n < optimizer->num_stems; n++, stem++ )
     {
-      LOG(( " %c%2d [%.1f]=<%1.f..%1.f> force=%.1f speed=%.1f\n",
-            optimizer->vertical ? 'V' : 'H', n,
-            FLOAT( stem->pos ),
-            FLOAT( stem->min_pos ), FLOAT( stem->max_pos ),
-            FLOAT( stem->force ),   FLOAT( stem->velocity ) ));
+      AH_OPTIM_LOG(( " %c%2d [%.1f]=<%1.f..%1.f> force=%.1f speed=%.1f\n",
+                     optimizer->vertical ? 'V' : 'H', n,
+                     FLOAT( stem->pos ),
+                     FLOAT( stem->min_pos ), FLOAT( stem->max_pos ),
+                     FLOAT( stem->force ),   FLOAT( stem->velocity ) ));
     }
   }
 
@@ -127,19 +127,19 @@
 
     spring = optimizer->springs;
     stems  = optimizer->stems;
-    LOG(( "%cSprings ", optimizer->vertical ? 'V' : 'H' ));
+    AH_OPTIM_LOG(( "%cSprings ", optimizer->vertical ? 'V' : 'H' ));
 
     for ( n = 0; n < optimizer->num_springs; n++, spring++ )
     {
-      LOG(( " [%d-%d:%.1f:%1.f:%.1f]",
-            spring->stem1 - stems, spring->stem2 - stems,
-            FLOAT( spring->owidth ),
-            FLOAT( spring->stem2->pos -
-                   ( spring->stem1->pos + spring->stem1->width ) ),
-            FLOAT( spring->tension ) ));
+      AH_OPTIM_LOG(( " [%d-%d:%.1f:%1.f:%.1f]\n",
+                     spring->stem1 - stems, spring->stem2 - stems,
+                     FLOAT( spring->owidth ),
+                     FLOAT( spring->stem2->pos -
+                            ( spring->stem1->pos + spring->stem1->width ) ),
+                     FLOAT( spring->tension ) ));
     }
 
-    LOG(( "\n" ));
+    AH_OPTIM_LOG(( "\n" ));
   }
 
 #endif /* AH_DEBUG_OPTIM */
@@ -600,8 +600,9 @@
     {
       AH_Stem*  stem1 = spring->stem1;
       AH_Stem*  stem2 = spring->stem2;
-      FT_Pos  width;
+      FT_Pos    width;
 
+
       width  = stem2->pos - ( stem1->pos + stem1->width );
       width -= spring->owidth;
       if ( width < 0 )
@@ -625,13 +626,13 @@
 
 
     distortion = optim_compute_distortion( optimizer );
-    LOG(( "config distortion = %.1f ", FLOAT( distortion * 64 ) ));
+    AH_OPTIM_LOG(( "config distortion = %.1f ", FLOAT( distortion * 64 ) ));
 
     /* check that we really need to add this configuration to our */
     /* sorted history                                             */
     if ( limit > configs && limit[-1].distortion < distortion )
     {
-      LOG(( "ejected\n" ));
+      AH_OPTIM_LOG(( "ejected\n" ));
       return;
     }
 
@@ -664,7 +665,7 @@
       config[0] = config[1];
       config[1] = temp;
     }
-    LOG(( "recorded!\n" ));
+    AH_OPTIM_LOG(( "recorded!\n" ));
   }
 
 
@@ -818,7 +819,7 @@
     optimizer->outline = outline;
     optimizer->memory  = memory;
 
-    LOG(( "initializing new optimizer\n" ));
+    AH_OPTIM_LOG(( "initializing new optimizer\n" ));
     /* compute stems and springs */
     error = optim_compute_stems  ( optimizer ) ||
             optim_compute_springs( optimizer );
@@ -862,7 +863,7 @@
 
     if ( optimizer->num_springs > 0 )
     {
-      LOG(( "horizontal optimization ------------------------\n" ));
+      AH_OPTIM_LOG(( "horizontal optimization ------------------------\n" ));
       optim_compute( optimizer );
     }
 
@@ -873,7 +874,7 @@
 
     if ( optimizer->num_springs )
     {
-      LOG(( "vertical optimization --------------------------\n" ));
+      AH_OPTIM_LOG(( "vertical optimization --------------------------\n" ));
       optim_compute( optimizer );
     }
   }
--- a/src/autohint/ahtypes.h
+++ b/src/autohint/ahtypes.h
@@ -251,9 +251,9 @@
   /*    contour    :: A pointer to the first point of the segment's        */
   /*                  contour.                                             */
   /*                                                                       */
-  /*    pos        :: The segment position in font units.                  */
+  /*    min_coord  :: The minimum coordinate of the segment.               */
   /*                                                                       */
-  /*    size       :: The segment size.                                    */
+  /*    max_coord  :: The maximum coordinate of the segment.               */
   /*                                                                       */
   /*    edge       :: The edge of the current segment.                     */
   /*                                                                       */
@@ -320,12 +320,12 @@
   /*                                                                       */
   /*    serif      :: The serif edge.                                      */
   /*                                                                       */
-  /*    num_paired :: The number of other edges that pair to this one.     */
+  /*    num_linked :: The number of other edges that pair to this one.     */
   /*                                                                       */
   /*    score      :: Used to score the edge when selecting them.          */
   /*                                                                       */
   /*    blue_edge  :: Indicate the blue zone edge this edge is related to. */
-  /*                  Only set for some of the horizontal edges in a Latin */
+  /*                  Only set for some of the horizontal edges in a latin */
   /*                  font.                                                */
   /*                                                                       */
   typedef struct  AH_EdgeRec_
@@ -368,7 +368,7 @@
 
     FT_Int        max_contours;
     FT_Int        num_contours;
-    AH_Point *    contours;
+    AH_Point*     contours;
 
     FT_Int        num_hedges;
     AH_Edge       horz_edges;
@@ -399,7 +399,7 @@
 
 #define AH_BLUE_CAPITAL_TOP     0                              /* THEZOCQS */
 #define AH_BLUE_CAPITAL_BOTTOM  ( AH_BLUE_CAPITAL_TOP + 1 )    /* HEZLOCUS */
-#define AH_BLUE_SMALL_TOP       ( AH_BLUE_CAPITAL_BOTTOM + 1)  /* xzroesc  */
+#define AH_BLUE_SMALL_TOP       ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* xzroesc  */
 #define AH_BLUE_SMALL_BOTTOM    ( AH_BLUE_SMALL_TOP + 1 )      /* xzroesc  */
 #define AH_BLUE_SMALL_MINOR     ( AH_BLUE_SMALL_BOTTOM + 1 )   /* pqgjy    */
 #define AH_BLUE_MAX             ( AH_BLUE_SMALL_MINOR + 1 )
@@ -429,6 +429,9 @@
   /*                                                                       */
   /*    num_heights :: The number of heights.                              */
   /*                                                                       */
+  /*    stds        :: A two-element array giving the default stem width   */
+  /*                   and height.                                         */
+  /*                                                                       */
   /*    widths      :: Snap widths, including standard one.                */
   /*                                                                       */
   /*    heights     :: Snap height, including standard one.                */
@@ -474,6 +477,9 @@
   /*                                                                       */
   /*    y_scale :: The current vertical scale.                             */
   /*                                                                       */
+  /*    control_overshoot ::                                               */
+  /*               Currently unused.                                       */
+  /*                                                                       */
   typedef struct  AH_Face_GlobalsRec_
   {
     FT_Face        face;
@@ -486,39 +492,39 @@
   } AH_Face_GlobalsRec, *AH_Face_Globals;
 
 
-  typedef struct  AH_HinterRec
+  typedef struct  AH_HinterRec_
   {
-    FT_Memory         memory;
-    AH_Hinter_Flags   flags;
+    FT_Memory        memory;
+    AH_Hinter_Flags  flags;
 
-    FT_Int            algorithm;
-    FT_Face           face;
+    FT_Int           algorithm;
+    FT_Face          face;
 
-    AH_Face_Globals   globals;
+    AH_Face_Globals  globals;
 
-    AH_Outline        glyph;
+    AH_Outline       glyph;
 
-    AH_Loader         loader;
-    FT_Vector         pp1;
-    FT_Vector         pp2;
+    AH_Loader        loader;
+    FT_Vector        pp1;
+    FT_Vector        pp2;
 
-    FT_Bool           transformed;
-    FT_Vector         trans_delta;
-    FT_Matrix         trans_matrix;
+    FT_Bool          transformed;
+    FT_Vector        trans_delta;
+    FT_Matrix        trans_matrix;
 
-    FT_Bool           do_horz_hints;     /* disable X hinting            */
-    FT_Bool           do_vert_hints;     /* disable Y hinting            */
-    FT_Bool           do_horz_snapping;  /* disable X stem size snapping */
-    FT_Bool           do_vert_snapping;  /* disable Y stem size snapping */
-    FT_Bool           do_stem_adjust;    /* disable light stem snapping  */
+    FT_Bool          do_horz_hints;     /* disable X hinting            */
+    FT_Bool          do_vert_hints;     /* disable Y hinting            */
+    FT_Bool          do_horz_snapping;  /* disable X stem size snapping */
+    FT_Bool          do_vert_snapping;  /* disable Y stem size snapping */
+    FT_Bool          do_stem_adjust;    /* disable light stem snapping  */
 
   } AH_HinterRec, *AH_Hinter;
 
 
-#ifdef  DEBUG_HINTER
-  extern AH_Hinter   ah_debug_hinter;
-  extern FT_Bool     ah_debug_disable_horz;
-  extern FT_Bool     ah_debug_disable_vert;
+#ifdef DEBUG_HINTER
+  extern AH_Hinter  ah_debug_hinter;
+  extern FT_Bool    ah_debug_disable_horz;
+  extern FT_Bool    ah_debug_disable_vert;
 #else
 #define ah_debug_disable_horz  0
 #define ah_debug_disable_vert  0
--- a/src/autohint/rules.mk
+++ b/src/autohint/rules.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2000, 2001 Catharon Productions Inc.
+# Copyright 2000, 2001, 2002 Catharon Productions Inc.
 # Author: David Turner
 #
 # This file is part of the Catharon Typography Project and shall only
@@ -29,10 +29,10 @@
 
 # AUTO driver sources (i.e., C files)
 #
-AUTO_DRV_SRC := $(AUTO_DIR_)ahangles.c  \
-                $(AUTO_DIR_)ahglobal.c  \
-                $(AUTO_DIR_)ahglyph.c   \
-                $(AUTO_DIR_)ahhint.c    \
+AUTO_DRV_SRC := $(AUTO_DIR_)ahangles.c \
+                $(AUTO_DIR_)ahglobal.c \
+                $(AUTO_DIR_)ahglyph.c  \
+                $(AUTO_DIR_)ahhint.c   \
                 $(AUTO_DIR_)ahmodule.c
 
 # AUTO driver headers
@@ -39,7 +39,7 @@
 #
 AUTO_DRV_H := $(AUTO_DRV_SRC:%c=%h)  \
               $(AUTO_DIR_)ahloader.h \
-              $(AUTO_DIR_)ahtypes.h \
+              $(AUTO_DIR_)ahtypes.h  \
               $(AUTO_DIR_)aherrors.h