fixing a scaling bug in the TrueType glyph loader that generated ugly artefacts when the TrueType bytecode interpreter was compiled in
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 77 78 79 80 81
diff --git a/ChangeLog b/ChangeLog
index 5dbb153..693a58b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-06-21 David Turner <david@freetype.org>
+
+ * src/base/ftobjs.c: documentation fix
+
+ * src/truetype/ttgload.c: fixing a scaling bug that caused incorrect
+ rendering when the bytecode interpreter was enabled.
+
2004-06-14 Huw D M Davies <h.davies1@physics.ox.ac.uk>
* src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem
@@ -16,7 +23,7 @@
2004-06-10 David Turner <david@freetype.org>
* src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
- src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
+ src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
Obsolete.
* src/raster/ftraster.c (Alignment, PAlignment): New union to fix
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 8b0256e..bbd6ce6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1999,7 +1999,7 @@
if ( char_height < 1 * 64 )
char_height = 1 * 64;
- /* Compute pixel sizes in 26.6 units with rounding */
+ /* Compute pixel sizes in 26.6 units */
dim_x = ( char_width * horz_resolution + 36 ) / 72;
dim_y = ( char_height * vert_resolution + 36 ) / 72;
@@ -2007,7 +2007,6 @@
FT_UShort x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 );
FT_UShort y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 );
-
if ( x_ppem == metrics->x_ppem && y_ppem == metrics->y_ppem )
return FT_Err_Ok;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 0256ee6..9fc2d03 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -206,7 +206,7 @@
*tsb = face->os2.sTypoAscender;
*ah = face->os2.sTypoAscender - face->os2.sTypoDescender;
}
- else
+ else
{
*tsb = face->horizontal.Ascender;
*ah = face->horizontal.Ascender - face->horizontal.Descender;
@@ -778,9 +778,8 @@
{
FT_Vector* vec = zone->cur;
FT_Vector* limit = vec + n_points;
- FT_Fixed x_scale = load->size->metrics.x_scale;
- FT_Fixed y_scale = load->size->metrics.y_scale;
-
+ FT_Fixed x_scale = ((TT_Size)load->size)->metrics.x_scale;
+ FT_Fixed y_scale = ((TT_Size)load->size)->metrics.y_scale;
/* first scale the glyph points */
for ( ; vec < limit; vec++ )
@@ -912,8 +911,8 @@
y_scale = 0x10000L;
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
- x_scale = loader->size->metrics.x_scale;
- y_scale = loader->size->metrics.y_scale;
+ x_scale = ((TT_Size)loader->size)->metrics.x_scale;
+ y_scale = ((TT_Size)loader->size)->metrics.y_scale;
}
/* get metrics, horizontal and vertical */