diff -ru freetype-2.3.1/src/autofit/aflatin.c freetype-2.3.2/src/autofit/aflatin.c
--- freetype-2.3.1/src/autofit/aflatin.c	2007-01-25 09:35:44.000000000 +0000
+++ freetype-2.3.2/src/autofit/aflatin.c	2007-03-05 16:47:02.000000000 +0000
@@ -479,7 +479,7 @@
           if ( dim == AF_DIMENSION_HORZ )
           {
             if ( fitted < scaled )
-              scale -= scale/50;  /* x_scale = x_scale*0.98 */
+              scale -= scale / 50;  /* scale *= 0.98 */
           }
           else
           {
@@ -907,7 +907,6 @@
     AF_AxisHints  axis          = &hints->axis[dim];
     AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
-    AF_Direction  major_dir     = axis->major_dir;
     FT_Pos        len_threshold, len_score;
     AF_Segment    seg1, seg2;
 
@@ -923,11 +922,11 @@
     {
       /* the fake segments are introduced to hint the metrics -- */
       /* we must never link them to anything                     */
-      if ( seg1->first == seg1->last || seg1->dir != major_dir )
+      if ( seg1->first == seg1->last )
         continue;
 
-      for ( seg2 = segments; seg2 < segment_limit; seg2++ )
-        if ( seg2 != seg1 && seg1->dir + seg2->dir == 0 )
+      for ( seg2 = seg1 + 1; seg2 < segment_limit; seg2++ )
+        if ( seg1->dir + seg2->dir == 0 )
         {
           FT_Pos  pos1 = seg1->pos;
           FT_Pos  pos2 = seg2->pos;
@@ -935,7 +934,7 @@
 
 
           if ( dist < 0 )
-            continue;
+            dist = -dist;
 
           {
             FT_Pos  min = seg1->min_coord;
@@ -1020,7 +1019,7 @@
      *  corresponding threshold in font units.
      */
     if ( dim == AF_DIMENSION_HORZ )
-        segment_length_threshold = FT_DivFix( 96, hints->y_scale );
+        segment_length_threshold = FT_DivFix( 64, hints->y_scale );
     else
         segment_length_threshold = 0;
 
@@ -1057,6 +1056,12 @@
       if ( seg->height < segment_length_threshold )
         continue;
 
+      /* A special case for serif edges: If they are smaller than */
+      /* 1.5 pixels we ignore them.                               */
+      if ( seg->serif                                     &&
+           2 * seg->height < 3 * segment_length_threshold )
+        continue;
+
       /* look for an edge corresponding to the segment */
       for ( ee = 0; ee < axis->num_edges; ee++ )
       {
@@ -2139,7 +2144,7 @@
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
 #ifdef AF_USE_WARPER
-      if ( ( dim == AF_DIMENSION_HORZ && 
+      if ( ( dim == AF_DIMENSION_HORZ &&
              metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )
       {
         AF_WarperRec  warper;
diff -ru freetype-2.3.1/src/autofit/afloader.c freetype-2.3.2/src/autofit/afloader.c
--- freetype-2.3.1/src/autofit/afloader.c	2007-01-30 23:07:53.000000000 +0000
+++ freetype-2.3.2/src/autofit/afloader.c	2007-02-12 21:42:09.000000000 +0000
@@ -183,8 +183,8 @@
 
         if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )
         {
-          old_advance = loader->pp2.x;
-          old_rsb     = old_advance - edge2->opos;
+          old_advance = loader->pp2.x - loader->pp1.x;
+          old_rsb     = loader->pp2.x - edge2->opos;
           old_lsb     = edge1->opos;
           new_lsb     = edge1->pos;
 
@@ -198,18 +198,18 @@
           /* for very small sizes                        */
 
           if ( old_lsb < 24 )
-            pp1x_uh -= 5;
+            pp1x_uh -= 8;
 
           if ( old_rsb < 24 )
-            pp2x_uh += 5;
+            pp2x_uh += 8;
 
           loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
           loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
 
-          if ( loader->pp1.x >= new_lsb )
+          if ( loader->pp1.x >= new_lsb && old_lsb > 0 )
             loader->pp1.x -= 64;
 
-          if ( loader->pp2.x <= pp2x_uh )
+          if ( loader->pp2.x <= edge2->pos && old_rsb > 0 )
             loader->pp2.x += 64;
 
           slot->lsb_delta = loader->pp1.x - pp1x_uh;
@@ -422,7 +422,11 @@
                                                x_scale );
 #else
       if ( !FT_IS_FIXED_WIDTH( slot->face ) )
-        slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
+      {
+        /* non-spacing glyphs must stay as-is */
+        if ( slot->metrics.horiAdvance )
+          slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
+      }
       else
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                metrics->scaler.x_scale );
