|
|
|
@ -190,43 +190,32 @@ |
|
|
|
|
FT_UInt horz_resolution, |
|
|
|
|
FT_UInt vert_resolution ) |
|
|
|
|
{ |
|
|
|
|
FT_Size_Metrics* metrics = &size->root.metrics; |
|
|
|
|
TT_Face face = (TT_Face)size->root.face; |
|
|
|
|
FT_Size_Metrics* metrics = &size->root.metrics; |
|
|
|
|
FT_Size_Metrics* metrics2 = &size->metrics; |
|
|
|
|
TT_Face face = (TT_Face)size->root.face; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*metrics2 = *metrics; |
|
|
|
|
|
|
|
|
|
/* This bit flag, when set, indicates that the pixel size must be */ |
|
|
|
|
/* truncated to an integer. Nearly all TrueType fonts have this */ |
|
|
|
|
/* bit set, as hinting won't work really well otherwise. */ |
|
|
|
|
/* */ |
|
|
|
|
/* However, for those rare fonts who do not set it, we override */ |
|
|
|
|
/* the default computations performed by the base layer. I */ |
|
|
|
|
/* really don't know whether this is useful, but hey, that's the */ |
|
|
|
|
/* spec :-) */ |
|
|
|
|
/* */ |
|
|
|
|
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER |
|
|
|
|
if ( ( face->header.Flags & 8 ) == 0 ) |
|
|
|
|
if ( ( face->header.Flags & 8 ) != 0 ) |
|
|
|
|
{ |
|
|
|
|
/* Compute pixel sizes in 26.6 units */ |
|
|
|
|
FT_Long dim_x, dim_y; |
|
|
|
|
|
|
|
|
|
dim_x = ( char_width * horz_resolution + 36 ) / 72; |
|
|
|
|
dim_y = ( char_height * vert_resolution + 36 ) / 72; |
|
|
|
|
|
|
|
|
|
metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); |
|
|
|
|
metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); |
|
|
|
|
/* we need to use rounding in the following computations. Otherwise,
|
|
|
|
|
* the resulting hinted outlines will be very slightly distorted |
|
|
|
|
*/ |
|
|
|
|
dim_x = ( ( ( char_width * horz_resolution ) / 72 ) + 32 ) & -64; |
|
|
|
|
dim_y = ( ( ( char_height * vert_resolution ) / 72 ) + 32 ) & -64; |
|
|
|
|
|
|
|
|
|
metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); |
|
|
|
|
metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); |
|
|
|
|
metrics2->x_ppem = (FT_UShort)( dim_x >> 6 ); |
|
|
|
|
metrics2->y_ppem = (FT_UShort)( dim_y >> 6 ); |
|
|
|
|
metrics2->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); |
|
|
|
|
metrics2->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
FT_UNUSED( vert_resolution ); |
|
|
|
|
FT_UNUSED( horz_resolution ); |
|
|
|
|
FT_UNUSED( char_height ); |
|
|
|
|
FT_UNUSED( char_width ); |
|
|
|
|
|
|
|
|
|
FT_UNUSED( face ); |
|
|
|
|
FT_UNUSED( metrics ); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
size->ttmetrics.valid = FALSE; |
|
|
|
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS |
|
|
|
@ -267,6 +256,7 @@ |
|
|
|
|
|
|
|
|
|
/* many things have been pre-computed by the base layer */ |
|
|
|
|
|
|
|
|
|
size->metrics = size->root.metrics; |
|
|
|
|
size->ttmetrics.valid = FALSE; |
|
|
|
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS |
|
|
|
|
size->strike_index = 0xFFFF; |
|
|
|
|