X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=lib%2F3rdparty%2Ffreetype%2Fsrc%2Fbase%2Fftpfr.c;h=f9592bb1bba29b680f45a65ba2b6b75b99a933db;hp=9e930ddf7e3c83b5273803a58d8404c1bae13ca0;hb=de271b9b4fe5b4a78652cfd70acba043e610f604;hpb=40f4c114ee3d73d4450cd2c939502bb641995344 diff --git a/lib/3rdparty/freetype/src/base/ftpfr.c b/lib/3rdparty/freetype/src/base/ftpfr.c index 9e930ddf7e3..f9592bb1bba 100644 --- a/lib/3rdparty/freetype/src/base/ftpfr.c +++ b/lib/3rdparty/freetype/src/base/ftpfr.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing PFR-specific data (body). */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002, 2003, 2004, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -46,6 +46,9 @@ FT_Service_PfrMetrics service; + if ( !face ) + return FT_Err_Invalid_Argument; + service = ft_pfr_check( face ); if ( service ) { @@ -55,14 +58,17 @@ ametrics_x_scale, ametrics_y_scale ); } - else if ( face ) + else { FT_Fixed x_scale, y_scale; /* this is not a PFR font */ - *aoutline_resolution = face->units_per_EM; - *ametrics_resolution = face->units_per_EM; + if ( aoutline_resolution ) + *aoutline_resolution = face->units_per_EM; + + if ( ametrics_resolution ) + *ametrics_resolution = face->units_per_EM; x_scale = y_scale = 0x10000L; if ( face->size ) @@ -70,11 +76,15 @@ x_scale = face->size->metrics.x_scale; y_scale = face->size->metrics.y_scale; } - *ametrics_x_scale = x_scale; - *ametrics_y_scale = y_scale; + + if ( ametrics_x_scale ) + *ametrics_x_scale = x_scale; + + if ( ametrics_y_scale ) + *ametrics_y_scale = y_scale; + + error = FT_Err_Unknown_File_Format; } - else - error = FT_Err_Invalid_Argument; return error; } @@ -92,14 +102,15 @@ FT_Service_PfrMetrics service; + if ( !face ) + return FT_Err_Invalid_Argument; + service = ft_pfr_check( face ); if ( service ) error = service->get_kerning( face, left, right, avector ); - else if ( face ) + else error = FT_Get_Kerning( face, left, right, FT_KERNING_UNSCALED, avector ); - else - error = FT_Err_Invalid_Argument; return error; }