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..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/include/freetype/config/ftmodule.h b/include/freetype/config/ftmodule.h
index 57164c8..88c72e2 100644
--- 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)
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 10621a4..1bc4faa 100644
--- 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;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 84d2ca0..69ca5a5 100644
--- 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 )
diff --git a/src/type1z/z1gload.c b/src/type1z/z1gload.c
index 7caa2e3..0b25d2e 100644
--- 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,12 +1416,9 @@
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;
glyph->root.outline.high_precision = size->root.metrics.y_ppem < 24;