fixed two bugs: - one bug in the auto-hinter that could cause some program crashes with certain fonts - fixed the loading of the font matrix "offset" parameters in Type 1 and CID-keyed fonts..
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
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index d81e68d..5536a7b 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -332,14 +332,14 @@
FT_Int max = outline->max_points;
- if ( REALLOC_ARRAY( outline->points, max, news, AH_Point ) ||
- REALLOC_ARRAY( outline->horz_edges, max, news, AH_Edge ) ||
- REALLOC_ARRAY( outline->horz_segments, max, news, AH_Segment ) )
+ if ( REALLOC_ARRAY( outline->points, max, news, AH_Point ) ||
+ REALLOC_ARRAY( outline->horz_edges, max*2, news*2, AH_Edge ) ||
+ REALLOC_ARRAY( outline->horz_segments, max*2, news*2, AH_Segment ) )
goto Exit;
/* readjust some pointers */
- outline->vert_edges = outline->horz_edges + ( news >> 1 );
- outline->vert_segments = outline->horz_segments + ( news >> 1 );
+ outline->vert_edges = outline->horz_edges + news;
+ outline->vert_segments = outline->horz_segments + news;
outline->max_points = news;
}
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 70c0d0b..52a6967 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -219,8 +219,11 @@
matrix->yx = temp[1];
matrix->xy = temp[2];
matrix->yy = temp[3];
- offset->x = temp[4];
- offset->y = temp[5];
+
+ /* note that the font offset are expressed in */
+ /* integer font units.. */
+ offset->x = temp[4] >> 16;
+ offset->y = temp[5] >> 16;
}
return T1_Err_Ok; /* this is a callback function; */
diff --git a/src/type1z/z1load.c b/src/type1z/z1load.c
index c87f7a1..8d15893 100644
--- a/src/type1z/z1load.c
+++ b/src/type1z/z1load.c
@@ -912,8 +912,11 @@
matrix->yx = temp[1];
matrix->xy = temp[2];
matrix->yy = temp[3];
- offset->x = temp[4];
- offset->y = temp[5];
+
+ /* note that the offset must be expressed in */
+ /* integer font units.. */
+ offset->x = temp[4] >> 16;
+ offset->y = temp[5] >> 16;
}