* src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount

dependent on ppem by scaling down for ppem < 25, then do normal
rounding.  This gives slightly better results than rounding towards
zero.
This commit is contained in:
Werner Lemberg 2004-12-12 06:55:40 +00:00
parent 62f8978794
commit 133eee06bf
4 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2004-12-11 Robert Clark <freetype@ratty.org.uk>
* src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount
dependent on ppem by scaling down for ppem < 25, then do normal
rounding. This gives slightly better results than rounding towards
zero.
2004-12-09 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero

View File

@ -2137,10 +2137,18 @@
if ( kern_mode != FT_KERNING_UNFITTED )
{
akerning->x = akerning->x > 0 ? FT_PIX_FLOOR( akerning->x )
: FT_PIX_CEIL( akerning->x );
akerning->y = akerning->y > 0 ? FT_PIX_FLOOR( akerning->y )
: FT_PIX_CEIL( akerning->y );
/* we scale down kerning values for small ppem values */
/* to avoid that rounding makes them too big. */
/* `25' has been determined heuristically. */
if ( face->size->metrics.x_ppem < 25 )
akerning->x = FT_MulDiv( akerning->x,
face->size->metrics.x_ppem, 25 );
if ( face->size->metrics.y_ppem < 25 )
akerning->y = FT_MulDiv( akerning->y,
face->size->metrics.y_ppem, 25 );
akerning->x = FT_PIX_ROUND( akerning->x );
akerning->y = FT_PIX_ROUND( akerning->y );
}
}
}

View File

@ -67,7 +67,7 @@ FT_BEGIN_HEADER
#undef FT_INVALID_
#define FT_INVALID_( _prefix, _error ) \
#define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid->root, _prefix ## _error )
#define OTV_OPTIONAL_TABLE( _table ) FT_UInt _table; \

View File

@ -1436,7 +1436,7 @@
error = face->goto_table( face, TTAG_EBDT, stream, 0 );
if ( error )
error = face->goto_table( face, TTAG_bdat, stream, 0 );
if (error)
if ( error )
goto Exit;
ebdt_pos = FT_STREAM_POS();