@ -65,22 +65,16 @@
/*************************************************************************/
/* */
/* Returns the horizontal metrics in font units for a given glyph. If */
/* `check' is true, take care of monospaced fonts by returning the */
/* advance width maximum. */
/* Return the horizontal metrics in font units for a given glyph. */
/* */
FT_LOCAL_DEF ( void )
TT_Get_HMetrics ( TT_Face face ,
FT_UInt idx ,
FT_Bool check ,
FT_Short * lsb ,
FT_UShort * aw )
{
( ( SFNT_Service ) face - > sfnt ) - > get_metrics ( face , 0 , idx , lsb , aw ) ;
if ( check & & face - > postscript . isFixedPitch )
* aw = face - > horizontal . advance_Width_Max ;
FT_TRACE5 ( ( " advance width (font units): %d \n " , * aw ) ) ;
FT_TRACE5 ( ( " left side bearing (font units): %d \n " , * lsb ) ) ;
}
@ -88,7 +82,7 @@
/*************************************************************************/
/* */
/* Returns the vertical metrics in font units for a given glyph. */
/* Return the vertical metrics in font units for a given glyph. */
/* Greg Hitchcock from Microsoft told us that if there were no `vmtx' */
/* table, typoAscender/Descender from the `OS/2' table would be used */
/* instead, and if there were no `OS/2' table, use ascender/descender */
@ -96,18 +90,12 @@
/* apparently does: It uses the ppem value as the advance height, and */
/* sets the top side bearing to be zero. */
/* */
/* The monospace `check' is probably not meaningful here, but we leave */
/* it in for a consistent interface. */
/* */
FT_LOCAL_DEF ( void )
TT_Get_VMetrics ( TT_Face face ,
FT_UInt idx ,
FT_Bool check ,
FT_Short * tsb ,
FT_UShort * ah )
{
FT_UNUSED ( check ) ;
if ( face - > vertical_info )
( ( SFNT_Service ) face - > sfnt ) - > get_metrics ( face , 1 , idx , tsb , ah ) ;
@ -150,13 +138,9 @@
TT_Get_HMetrics ( face , glyph_index ,
( FT_Bool ) ! ( loader - > load_flags &
FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) ,
& left_bearing ,
& advance_width ) ;
TT_Get_VMetrics ( face , glyph_index ,
( FT_Bool ) ! ( loader - > load_flags &
FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) ,
& top_bearing ,
& advance_height ) ;
@ -1655,23 +1639,7 @@
/* get the device-independent horizontal advance; it is scaled later */
/* by the base layer. */
{
FT_Pos advance = loader - > linear ;
/* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */
/* correctly support DynaLab fonts, which have an incorrect */
/* `advance_Width_Max' field! It is used, to my knowledge, */
/* exclusively in the X-TrueType font server. */
/* */
if ( face - > postscript . isFixedPitch & &
( loader - > load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) = = 0 )
advance = face - > horizontal . advance_Width_Max ;
/* we need to return the advance in font units in linearHoriAdvance, */
/* it will be scaled later by the base layer. */
glyph - > linearHoriAdvance = advance ;
}
glyph - > linearHoriAdvance = loader - > linear ;
glyph - > metrics . horiBearingX = bbox . xMin ;
glyph - > metrics . horiBearingY = bbox . yMax ;
@ -2049,9 +2017,6 @@
glyph - > linearHoriAdvance = loader . linear ;
glyph - > linearVertAdvance = loader . top_bearing + loader . bbox . yMax -
loader . vadvance ;
if ( face - > postscript . isFixedPitch & &
( load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) = = 0 )
glyph - > linearHoriAdvance = face - > horizontal . advance_Width_Max ;
}
return TT_Err_Ok ;