[cff] s/cf2_floatToFixed/cf2_doubleToFixed/.
The new name better describes what the macro actually does; additionally, we don't need a trailing `f' for literals (there was only a single such instance in the code, but this caused a clang warning because the macro itself uses `double' literals). * src/cff/cf2blues.c, src/cff/cf2blues.h, src/cff/cf2fixed.h, src/cff/cf2font.c, src/cff/cf2hints.c: Updated.
This commit is contained in:
parent
9357219082
commit
2e4188d833
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2017-05-28 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[cff] s/cf2_floatToFixed/cf2_doubleToFixed/.
|
||||
|
||||
The new name better describes what the macro actually does;
|
||||
additionally, we don't need a trailing `f' for literals (there was
|
||||
only a single such instance in the code, but this caused a clang
|
||||
warning because the macro itself uses `double' literals).
|
||||
|
||||
* src/cff/cf2blues.c, src/cff/cf2blues.h, src/cff/cf2fixed.h,
|
||||
src/cff/cf2font.c, src/cff/cf2hints.c: Updated.
|
||||
|
||||
2017-05-28 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Fix negation of INT_MIN and LONG_MIN (#46149).
|
||||
|
@ -408,8 +408,8 @@
|
||||
/* Note: constant changed from 0.5 to 0.6 to avoid a problem with */
|
||||
/* 10ppem Arial */
|
||||
|
||||
blues->boost = cf2_floatToFixed( .6 ) -
|
||||
FT_MulDiv( cf2_floatToFixed ( .6 ),
|
||||
blues->boost = cf2_doubleToFixed( .6 ) -
|
||||
FT_MulDiv( cf2_doubleToFixed ( .6 ),
|
||||
blues->scale,
|
||||
blues->blueScale );
|
||||
if ( blues->boost > 0x7FFF )
|
||||
|
@ -111,7 +111,7 @@ FT_BEGIN_HEADER
|
||||
* Constant used for hint adjustment and for synthetic em box hint
|
||||
* placement.
|
||||
*/
|
||||
#define CF2_MIN_COUNTER cf2_floatToFixed( 0.5 )
|
||||
#define CF2_MIN_COUNTER cf2_doubleToFixed( 0.5 )
|
||||
|
||||
|
||||
/* shared typedef is in cf2glue.h */
|
||||
|
@ -63,7 +63,7 @@ FT_BEGIN_HEADER
|
||||
( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
|
||||
#define cf2_fixedRound( x ) \
|
||||
( (CF2_Fixed)( ( (FT_UInt32)(x) + 0x8000U ) & 0xFFFF0000UL ) )
|
||||
#define cf2_floatToFixed( f ) \
|
||||
#define cf2_doubleToFixed( f ) \
|
||||
( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )
|
||||
#define cf2_fixedAbs( x ) \
|
||||
( (x) < 0 ? -(x) : (x) )
|
||||
|
@ -117,7 +117,7 @@
|
||||
return;
|
||||
|
||||
/* protect against range problems and divide by zero */
|
||||
if ( emRatio < cf2_floatToFixed( .01 ) )
|
||||
if ( emRatio < cf2_doubleToFixed( .01 ) )
|
||||
return;
|
||||
|
||||
if ( stemDarkened )
|
||||
|
@ -1063,7 +1063,7 @@
|
||||
cf2_fixedAbs( glyphpath->yOffset ) );
|
||||
|
||||
/* .1 character space unit */
|
||||
glyphpath->snapThreshold = cf2_floatToFixed( 0.1f );
|
||||
glyphpath->snapThreshold = cf2_doubleToFixed( 0.1 );
|
||||
|
||||
glyphpath->moveIsPending = TRUE;
|
||||
glyphpath->pathIsOpen = FALSE;
|
||||
@ -1489,9 +1489,9 @@
|
||||
else
|
||||
{
|
||||
/* +x +y */
|
||||
*x = FT_MulFix( cf2_floatToFixed( 0.7 ),
|
||||
*x = FT_MulFix( cf2_doubleToFixed( 0.7 ),
|
||||
glyphpath->xOffset );
|
||||
*y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),
|
||||
*y = FT_MulFix( cf2_doubleToFixed( 1.0 - 0.7 ),
|
||||
glyphpath->yOffset );
|
||||
}
|
||||
}
|
||||
@ -1514,9 +1514,9 @@
|
||||
else
|
||||
{
|
||||
/* +x -y */
|
||||
*x = FT_MulFix( cf2_floatToFixed( -0.7 ),
|
||||
*x = FT_MulFix( cf2_doubleToFixed( -0.7 ),
|
||||
glyphpath->xOffset );
|
||||
*y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),
|
||||
*y = FT_MulFix( cf2_doubleToFixed( 1.0 - 0.7 ),
|
||||
glyphpath->yOffset );
|
||||
}
|
||||
}
|
||||
@ -1542,9 +1542,9 @@
|
||||
else
|
||||
{
|
||||
/* -x +y */
|
||||
*x = FT_MulFix( cf2_floatToFixed( 0.7 ),
|
||||
*x = FT_MulFix( cf2_doubleToFixed( 0.7 ),
|
||||
glyphpath->xOffset );
|
||||
*y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),
|
||||
*y = FT_MulFix( cf2_doubleToFixed( 1.0 + 0.7 ),
|
||||
glyphpath->yOffset );
|
||||
}
|
||||
}
|
||||
@ -1567,9 +1567,9 @@
|
||||
else
|
||||
{
|
||||
/* -x -y */
|
||||
*x = FT_MulFix( cf2_floatToFixed( -0.7 ),
|
||||
*x = FT_MulFix( cf2_doubleToFixed( -0.7 ),
|
||||
glyphpath->xOffset );
|
||||
*y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),
|
||||
*y = FT_MulFix( cf2_doubleToFixed( 1.0 + 0.7 ),
|
||||
glyphpath->yOffset );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user