* 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.
This commit is contained in:
Wu, Chia-I (吳佳一) 2005-12-16 14:27:14 +00:00
parent db0182f056
commit dcb8b7103f
8 changed files with 25 additions and 50 deletions

View File

@ -1,3 +1,16 @@
2005-12-16 Chia-I Wu <b90201047@ntu.edu.tw>
* 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 <david@freetype.org> 2005-12-13 David Turner <david@freetype.org>
* src/autofit/aflatin.c, src/autofit/afhints.c: changed the * src/autofit/aflatin.c, src/autofit/afhints.c: changed the

View File

@ -14,6 +14,10 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
II. IMPORTANT CHANGES 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 - A new API `FT_TrueTypeGX_Validate' (in FT_GX_VALIDATE_H) has
been added to validate TrueType GX/ATT tables (feat, mort, morx, been added to validate TrueType GX/ATT tables (feat, mort, morx,
bsln, just, kern, opbd, trak, prop). After validation it is no bsln, just, kern, opbd, trak, prop). After validation it is no

View File

@ -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 * Free the bitmap of a given glyphslot when needed
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap). * (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).

View File

@ -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_BASE_DEF( void )
ft_glyphslot_set_bitmap( FT_GlyphSlot slot, ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
FT_Byte* buffer ) FT_Byte* buffer )
@ -1983,17 +1960,17 @@
{ {
/* Compute root ascender, descender, test height, and max_advance */ /* Compute root ascender, descender, test height, and max_advance */
metrics->ascender = FT_PIX_CEIL( FT_MulFix( face->ascender, metrics->ascender = FT_MulFix( face->ascender,
metrics->y_scale ) ); metrics->y_scale );
metrics->descender = FT_PIX_FLOOR( FT_MulFix( face->descender, metrics->descender = FT_MulFix( face->descender,
metrics->y_scale ) ); metrics->y_scale );
metrics->height = FT_PIX_ROUND( FT_MulFix( face->height, metrics->height = FT_MulFix( face->height,
metrics->y_scale ) ); metrics->y_scale );
metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width, metrics->max_advance = FT_MulFix( face->max_advance_width,
metrics->x_scale ) ); metrics->x_scale );
} }

View File

@ -2687,9 +2687,6 @@
metrics->horiBearingX = cbox.xMin; metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax; metrics->horiBearingY = cbox.yMax;
if ( hinting )
ft_glyphslot_grid_fit_metrics( &glyph->root );
} }
} }

View File

@ -402,9 +402,6 @@
/* make up vertical ones */ /* make up vertical ones */
metrics->vertBearingX = 0; metrics->vertBearingX = 0;
metrics->vertBearingY = 0; metrics->vertBearingY = 0;
if ( hinting )
ft_glyphslot_grid_fit_metrics( cidglyph );
} }
} }

View File

@ -1801,9 +1801,6 @@
glyph->metrics.width = bbox.xMax - bbox.xMin; glyph->metrics.width = bbox.xMax - bbox.xMin;
glyph->metrics.height = bbox.yMax - bbox.yMin; glyph->metrics.height = bbox.yMax - bbox.yMin;
if ( IS_HINTED( loader->load_flags ) )
ft_glyphslot_grid_fit_metrics( glyph );
return 0; return 0;
} }

View File

@ -359,9 +359,6 @@
/* make up vertical ones */ /* make up vertical ones */
metrics->vertBearingX = 0; metrics->vertBearingX = 0;
metrics->vertBearingY = 0; metrics->vertBearingY = 0;
if ( hinting )
ft_glyphslot_grid_fit_metrics( &glyph->root );
} }
/* Set control data to the glyph charstrings. Note that this is */ /* Set control data to the glyph charstrings. Note that this is */