ref: 133eee06bf52ae10054cce2dfa8ff40a6c15470b
parent: 62f8978794fd7736feaeaedd7ef3f62e1eb6a7eb
author: Werner Lemberg <[email protected]>
date: Sun Dec 12 01:55:40 EST 2004
* 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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-11 Robert Clark <[email protected]>
+
+ * 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 <[email protected]>
* src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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 );
}
}
}
--- a/src/otvalid/otvcommn.h
+++ b/src/otvalid/otvcommn.h
@@ -67,7 +67,7 @@
#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; \
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -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();