fixed a minor bug in the computation of the vertical metrics top-side bearing
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
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index c6fd2c8..bf24b4d 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -727,7 +727,6 @@
TT_UShort index;
TT_UShort u;
TT_Long count;
- TT_Long Top;
TT_Long glyph_offset, offset;
@@ -896,7 +895,6 @@
TT_Short left_bearing;
TT_UShort advance_width;
-
Get_HMetrics( face, index, TRUE,
&left_bearing,
&advance_width );
@@ -1263,10 +1261,10 @@
y = SCALE_Y( y );
if ( subglyph->element_flag & ROUND_XY_TO_GRID )
- {
- x = (x + 32) & -64;
- y = (y + 32) & -64;
- }
+ {
+ x = (x + 32) & -64;
+ y = (y + 32) & -64;
+ }
}
}
@@ -1328,8 +1326,10 @@
glyph->outline.second_pass = TRUE;
/* translate array so that (0,0) is the glyph's origin */
- translate_array( num_points + 2, glyph->outline.points,
- -subglyph->pp1.x, 0 );
+ translate_array( (TT_UShort)(num_points + 2),
+ glyph->outline.points,
+ -subglyph->pp1.x,
+ 0 );
FT_Get_Outline_CBox( &glyph->outline, &bbox );
@@ -1377,9 +1377,10 @@
TT_Short top_bearing; /* vertical top side bearing (EM units) */
TT_UShort advance_height; /* vertical advance height (EM units) */
- TT_Pos left; /* scaled vertical left side bearing */
- TT_Pos top; /* scaled vertical top side bearing */
- TT_Pos advance; /* scaled vertical advance height */
+ TT_Pos left; /* scaled vertical left side bearing */
+ TT_Pos Top; /* scaled original vertical top side bearing */
+ TT_Pos top; /* scaled vertical top side bearing */
+ TT_Pos advance; /* scaled vertical advance height */
/* Get the unscaled `tsb' and `ah' */
@@ -1433,7 +1434,7 @@
{
Top = SCALE_Y( top_bearing );
top = SCALE_Y( top_bearing + subglyph->bbox.yMax ) - bbox.yMax;
- advance = SCALE_X( advance_height );
+ advance = SCALE_Y( advance_height );
}
else
{