shithub: freetype+ttf2subf

Download patch

ref: c49f69cb8c9d9b38179f760bf0cbbe4c78a3e296
parent: bca332875d15c09292a76812e7ad10622efd7eb0
author: David Turner <[email protected]>
date: Wed Jul 19 23:44:50 EDT 2000

some welcome fixes related to the auto-hinter:

  - removed a stupid memory leak

  - fixed the weird metrics hinting (the horizontal edges were used,
    instead of the vertical one, to compute the metrics adjustments,
    silly, silly, silly).

there is still some bugs that I'm looking at though, but we're
very near the release..

git/fs: mount .git/fs: mount/attach disallowed
--- a/include/freetype/config/ftmodule.h
+++ b/include/freetype/config/ftmodule.h
@@ -1,3 +1,4 @@
+FT_USE_MODULE(autohint_module_class)
 FT_USE_MODULE(cff_driver_class)
 FT_USE_MODULE(t1cid_driver_class)
 FT_USE_MODULE(psnames_module_class)
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -836,6 +836,8 @@
       scaled->blue_refs  [n] = (FT_MulFix(design->blue_refs[n],y_scale)+32) & -64;
       scaled->blue_shoots[n] = scaled->blue_refs[n] + delta2;
     }
+    globals->x_scale = x_scale;
+    globals->y_scale = y_scale;
   }
 
 
@@ -1022,8 +1024,8 @@
            FT_Pos  old_width, new_width;
            FT_Pos  old_advance, new_advance;
            FT_Pos  old_lsb, new_lsb;
-           AH_Edge*  edge1   = hinter->glyph->horz_edges;            /* left-most edge  */
-           AH_Edge*  edge2   = edge1 + hinter->glyph->num_hedges-1;  /* right-mode edge */
+           AH_Edge*  edge1   = outline->vert_edges;            /* left-most edge  */
+           AH_Edge*  edge2   = edge1 + outline->num_vedges-1;  /* right-mode edge */
 
            old_width = edge2->opos - edge1->opos;
            new_width = edge2->pos  - edge1->pos;
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1120,7 +1120,10 @@
   {
     FT_Driver_Class*  clazz = driver->clazz;
 
-
+    /* discard auto-hinting data */
+    if ( face->autohint.finalizer )
+      face->autohint.finalizer( face->autohint.data );
+      
     /* Discard glyph slots for this face                           */
     /* Beware!  FT_Done_GlyphSlot() changes the field `face->slot' */
     while ( face->glyph )
--- a/src/type1z/z1gload.c
+++ b/src/type1z/z1gload.c
@@ -1390,6 +1390,9 @@
     /* bearing the yMax                                    */
     if ( !error )
     {
+      glyph->root.outline.flags &= ft_outline_owner;
+      glyph->root.outline.flags |= ft_outline_reverse_fill;
+      
       /* for composite glyphs, return only left side bearing and */
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
@@ -1413,11 +1416,8 @@
 
         glyph->root.format = ft_glyph_format_outline;
 
-        glyph->root.outline.flags &= ft_outline_owner;
         if ( size && size->root.metrics.y_ppem < 24 )
           glyph->root.outline.flags |= ft_outline_high_precision;
-
-        glyph->root.outline.flags |= ft_outline_reverse_fill;
 
 #if 0
         glyph->root.outline.second_pass    = TRUE;