ref: dcb8b7103fc8692cce093247188249fb786de2ff
parent: db0182f0560adbac0d225ff33a5b79e17a90a5b6
author: Wu, Chia-I (吳佳一) <[email protected]>
date: Fri Dec 16 09:27:14 EST 2005
* include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics), src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed. * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics), src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics. * doc/CHANGES: Mention the changes.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-12-16 Chia-I Wu <[email protected]>
+
+ * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
+ src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.
+
+ * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.
+
+ * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
+ (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
+ src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.
+
+ * doc/CHANGES: Mention the changes.
+
2005-12-13 David Turner <[email protected]>
* src/autofit/aflatin.c, src/autofit/afhints.c: changed the
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -14,6 +14,10 @@
II. IMPORTANT CHANGES
+ - Face metrics (face->size->metrics) and glyph metrics are no
+ longer rounded. If you do not round in your applications too,
+ you may find glyphs become blurry.
+
- A new API `FT_TrueTypeGX_Validate' (in FT_GX_VALIDATE_H) has
been added to validate TrueType GX/ATT tables (feat, mort, morx,
bsln, just, kern, opbd, trak, prop). After validation it is no
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -452,13 +452,6 @@
/* */
/*
- * grid-fit slot->metrics
- */
- FT_BASE( void )
- ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot );
-
-
- /*
* Free the bitmap of a given glyphslot when needed
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
*/
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -251,29 +251,6 @@
FT_BASE_DEF( void )
- ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot )
- {
- FT_Pos tmp;
-
-
- tmp = FT_PIX_CEIL( slot->metrics.horiBearingX + slot->metrics.width );
- slot->metrics.horiBearingX = FT_PIX_FLOOR( slot->metrics.horiBearingX );
- slot->metrics.width = tmp - slot->metrics.horiBearingX;
-
- tmp = FT_PIX_FLOOR( slot->metrics.horiBearingY - slot->metrics.height );
- slot->metrics.horiBearingY = FT_PIX_CEIL( slot->metrics.horiBearingY );
- slot->metrics.height = slot->metrics.horiBearingY - tmp;
-
- slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
-
- slot->metrics.vertBearingX = FT_PIX_FLOOR( slot->metrics.vertBearingX );
- /* note that vertBearingY should be floor'ed */
- slot->metrics.vertBearingY = FT_PIX_FLOOR( slot->metrics.vertBearingY );
- slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
- }
-
-
- FT_BASE_DEF( void )
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
FT_Byte* buffer )
{
@@ -1983,17 +1960,17 @@
{
/* Compute root ascender, descender, test height, and max_advance */
- metrics->ascender = FT_PIX_CEIL( FT_MulFix( face->ascender,
- metrics->y_scale ) );
+ metrics->ascender = FT_MulFix( face->ascender,
+ metrics->y_scale );
- metrics->descender = FT_PIX_FLOOR( FT_MulFix( face->descender,
- metrics->y_scale ) );
+ metrics->descender = FT_MulFix( face->descender,
+ metrics->y_scale );
- metrics->height = FT_PIX_ROUND( FT_MulFix( face->height,
- metrics->y_scale ) );
+ metrics->height = FT_MulFix( face->height,
+ metrics->y_scale );
- metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width,
- metrics->x_scale ) );
+ metrics->max_advance = FT_MulFix( face->max_advance_width,
+ metrics->x_scale );
}
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2687,9 +2687,6 @@
metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( &glyph->root );
}
}
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -402,9 +402,6 @@
/* make up vertical ones */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( cidglyph );
}
}
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1801,9 +1801,6 @@
glyph->metrics.width = bbox.xMax - bbox.xMin;
glyph->metrics.height = bbox.yMax - bbox.yMin;
- if ( IS_HINTED( loader->load_flags ) )
- ft_glyphslot_grid_fit_metrics( glyph );
-
return 0;
}
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -359,9 +359,6 @@
/* make up vertical ones */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( &glyph->root );
}
/* Set control data to the glyph charstrings. Note that this is */