diff --git a/ChangeLog b/ChangeLog index b103a8d51..edbf1dd63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-12-16 Chia-I Wu + + * 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 * src/autofit/aflatin.c, src/autofit/afhints.c: changed the diff --git a/docs/CHANGES b/docs/CHANGES index 0365534db..37ed7ebad 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -14,6 +14,10 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.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 diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index ca5196a1b..49f68008a 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -451,13 +451,6 @@ FT_BEGIN_HEADER /* */ - /* - * 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). diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 5199e294d..84436e181 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -250,29 +250,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 ); } diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index 7ac2fcd04..ef67835e2 100644 --- 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 ); } } diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c index d61d9593a..12d749d50 100644 --- 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 ); } } diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index bdd0a06b6..ebbd7a06f 100644 --- 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; } diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 54c9b683e..88c57da3f 100644 --- 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 */