| Index: third_party/freetype/src/base/ftmac.c
|
| diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/ftmac.c b/third_party/freetype/src/base/ftmac.c
|
| similarity index 97%
|
| rename from core/src/fxge/fx_freetype/fxft2.5.01/src/base/ftmac.c
|
| rename to third_party/freetype/src/base/ftmac.c
|
| index 76361d92cd10747a3e210b4fbc0bee246857c19a..5301ab44fc03c5a75fbc94816242cf3bdf6649c6 100644
|
| --- a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/ftmac.c
|
| +++ b/third_party/freetype/src/base/ftmac.c
|
| @@ -8,7 +8,7 @@
|
| /* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
|
| /* classic platforms built by MPW. */
|
| /* */
|
| -/* Copyright 1996-2009, 2013 by */
|
| +/* Copyright 1996-2009, 2013, 2014 by */
|
| /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
| /* */
|
| /* This file is part of the FreeType project, and may only be used, */
|
| @@ -65,10 +65,10 @@
|
| */
|
|
|
|
|
| -#include "../../include/ft2build.h"
|
| -#include "../../include/freetype/freetype.h"
|
| -#include "../../include/freetype/tttags.h"
|
| -#include "../../include/freetype/internal/ftstream.h"
|
| +#include <ft2build.h>
|
| +#include FT_FREETYPE_H
|
| +#include FT_TRUETYPE_TAGS_H
|
| +#include FT_INTERNAL_STREAM_H
|
| #include "ftbase.h"
|
|
|
| /* This is for Mac OS X. Without redefinition, OS_INLINE */
|
| @@ -103,7 +103,7 @@
|
| /* Don't want warnings about our own use of deprecated functions. */
|
| #define FT_DEPRECATED_ATTRIBUTE
|
|
|
| -#include "../../include/freetype/ftmac.h"
|
| +#include FT_MAC_H
|
|
|
| #ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */
|
| #define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault
|
| @@ -227,6 +227,9 @@
|
| FT_Error err;
|
|
|
|
|
| + if ( !fontName || !face_index )
|
| + return FT_THROW( Invalid_Argument) ;
|
| +
|
| err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
|
| if ( err )
|
| return err;
|
| @@ -256,6 +259,9 @@
|
| FT_Error err;
|
|
|
|
|
| + if ( !fontName || !face_index )
|
| + return FT_THROW( Invalid_Argument );
|
| +
|
| err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
|
| if ( err )
|
| return err;
|
| @@ -440,9 +446,10 @@
|
| style = (StyleTable*)p;
|
| p += sizeof ( StyleTable );
|
| string_count = EndianS16_BtoN( *(short*)(p) );
|
| + string_count = FT_MIN( 64, string_count );
|
| p += sizeof ( short );
|
|
|
| - for ( i = 0; i < string_count && i < 64; i++ )
|
| + for ( i = 0; i < string_count; i++ )
|
| {
|
| names[i] = p;
|
| p += names[i][0];
|
| @@ -459,7 +466,7 @@
|
| ps_name[ps_name_len] = 0;
|
| }
|
| if ( style->indexes[face_index] > 1 &&
|
| - style->indexes[face_index] <= FT_MIN( string_count, 64 ) )
|
| + style->indexes[face_index] <= string_count )
|
| {
|
| unsigned char* suffixes = names[style->indexes[face_index] - 1];
|
|
|
| @@ -852,6 +859,8 @@
|
| FT_Error error = FT_Err_Ok;
|
|
|
|
|
| + /* check of `library' and `aface' delayed to `FT_New_Face_From_XXX' */
|
| +
|
| GetResInfo( fond, &fond_id, &fond_type, fond_name );
|
| if ( ResError() != noErr || fond_type != TTAG_FOND )
|
| return FT_THROW( Invalid_File_Format );
|
| @@ -963,7 +972,6 @@
|
| if ( !pathname )
|
| return FT_THROW( Invalid_Argument );
|
|
|
| - error = FT_Err_Ok;
|
| *aface = NULL;
|
|
|
| /* try resourcefork based font: LWFN, FFIL */
|
| @@ -998,10 +1006,14 @@
|
| {
|
| FT_Error error;
|
| FT_Open_Args args;
|
| - OSErr err;
|
| - UInt8 pathname[PATH_MAX];
|
| +
|
| + OSErr err;
|
| + UInt8 pathname[PATH_MAX];
|
|
|
|
|
| + /* check of `library' and `aface' delayed to */
|
| + /* `FT_New_Face_From_Resource' */
|
| +
|
| if ( !ref )
|
| return FT_THROW( Invalid_Argument );
|
|
|
| @@ -1048,6 +1060,8 @@
|
| FSRef ref;
|
|
|
|
|
| + /* check of `library' and `aface' delayed to `FT_New_Face_From_FSRef' */
|
| +
|
| if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr )
|
| return FT_THROW( Invalid_Argument );
|
| else
|
|
|