diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c index 0996d107933..d60cc3ee53f 100644 --- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c +++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfdrivr.c @@ -492,8 +492,6 @@ THE SOFTWARE. PCF_Metric metric; FT_ULong bytes; - FT_UNUSED( load_flags ); - FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index )); @@ -550,6 +548,24 @@ THE SOFTWARE. return FT_THROW( Invalid_File_Format ); } + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = metric->leftSideBearing; + slot->bitmap_top = metric->ascent; + + slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 ); + slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 ); + slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 ); + slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing - + metric->leftSideBearing ) * 64 ); + slot->metrics.height = (FT_Pos)( bitmap->rows * 64 ); + + ft_synthesize_vertical_metrics( &slot->metrics, + ( face->accel.fontAscent + + face->accel.fontDescent ) * 64 ); + + if ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) + goto Exit; + /* XXX: to do: are there cases that need repadding the bitmap? */ bytes = (FT_ULong)bitmap->pitch * bitmap->rows; @@ -582,21 +598,6 @@ THE SOFTWARE. } } - slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->bitmap_left = metric->leftSideBearing; - slot->bitmap_top = metric->ascent; - - slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 ); - slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 ); - slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 ); - slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing - - metric->leftSideBearing ) * 64 ); - slot->metrics.height = (FT_Pos)( bitmap->rows * 64 ); - - ft_synthesize_vertical_metrics( &slot->metrics, - ( face->accel.fontAscent + - face->accel.fontDescent ) * 64 ); - Exit: return error; } @@ -617,7 +618,7 @@ THE SOFTWARE. prop = pcf_find_property( face, prop_name ); - if ( prop != NULL ) + if ( prop ) { if ( prop->isString ) { @@ -700,10 +701,10 @@ THE SOFTWARE. 0x10000L, 0x20000L, - 0, /* module-specific interface */ + NULL, /* module-specific interface */ - 0, /* FT_Module_Constructor module_init */ - 0, /* FT_Module_Destructor module_done */ + NULL, /* FT_Module_Constructor module_init */ + NULL, /* FT_Module_Destructor module_done */ pcf_driver_requester /* FT_Module_Requester get_interface */ }, @@ -713,16 +714,16 @@ THE SOFTWARE. PCF_Face_Init, /* FT_Face_InitFunc init_face */ PCF_Face_Done, /* FT_Face_DoneFunc done_face */ - 0, /* FT_Size_InitFunc init_size */ - 0, /* FT_Size_DoneFunc done_size */ - 0, /* FT_Slot_InitFunc init_slot */ - 0, /* FT_Slot_DoneFunc done_slot */ + NULL, /* FT_Size_InitFunc init_size */ + NULL, /* FT_Size_DoneFunc done_size */ + NULL, /* FT_Slot_InitFunc init_slot */ + NULL, /* FT_Slot_DoneFunc done_slot */ PCF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetKerningFunc get_kerning */ - 0, /* FT_Face_AttachFunc attach_file */ - 0, /* FT_Face_GetAdvancesFunc get_advances */ + NULL, /* FT_Face_GetKerningFunc get_kerning */ + NULL, /* FT_Face_AttachFunc attach_file */ + NULL, /* FT_Face_GetAdvancesFunc get_advances */ PCF_Size_Request, /* FT_Size_RequestFunc request_size */ PCF_Size_Select /* FT_Size_SelectFunc select_size */ |