Fri 01 Aug 2008 08:08:29 AM UTC, original submission:
I encountered a problem when the font matrix of a cff font is expressed in integers instead of reals. Font matrix was (normal integers) 1 0 0 1 0 0, the resulting matrix in freetype (2.3.7) was (FT_Fixed) 0x10000 0 0 1 0 0.
The problem was tracked back to cffparse.cpp, cff_parse_fixed_scaled.
original:
/* read a floating point number, either integer or real, */
/* but return `10^scaling' times the number read in */
static FT_Fixed
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
{
return **d ==
30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: (FT_Fixed)FT_MulFix( cff_parse_integer( d[0], d[1] ) << 16,
power_tens[scaling] );
}
fix:
/* read a floating point number, either integer or real, */
/* but return `10^scaling' times the number read in */
static FT_Fixed
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
{
return **d ==
30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: (FT_Fixed)( ( cff_parse_integer( d[0], d[1] )*power_tens[scaling] ) << 16 );
}
Regards,
Bram Tassyns (bramt@enfocus.be)
|