diff --git a/src/Platform.c b/src/Platform.c index 5b0b147ce..39c333af5 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -891,11 +891,11 @@ void Font_Make(FontDesc* desc, const String* fontName, int size, int style) { /* For OSX font suitcase files */ #ifdef CC_BUILD_OSX - char fileBuffer[FILENAME_SIZE + 1]; - String file = String_NT_Array(fileBuffer); - String_Copy(&file, &path); - file.buffer[file.length] = '\0'; - args.pathname = file.buffer; + char filenameBuffer[FILENAME_SIZE + 1]; + String filename = String_NT_Array(filenameBuffer); + String_Copy(&filename, &path); + filename.buffer[filename.length] = '\0'; + args.pathname = filename.buffer; #endif err = FT_New_Face(ft_lib, &args, 0, &face); @@ -948,7 +948,17 @@ static void Font_DirCallback(const String* path, void* obj) { FT_Error err; if (!Font_MakeArgs(path, &stream, &args)) return; - err = FT_Open_Face(ft_lib, &args, 0, &face); + + /* For OSX font suitcase files */ +#ifdef CC_BUILD_OSX + char filenameBuffer[FILENAME_SIZE + 1]; + String filename = String_NT_Array(filenameBuffer); + String_Copy(&filename, path); + filename.buffer[filename.length] = '\0'; + args.pathname = filename.buffer; +#endif + + err = FT_New_Face(ft_lib, &args, 0, &face); if (err) { stream.close(&stream); return; } if (face->style_flags == FT_STYLE_FLAG_BOLD) { diff --git a/src/freetype/ftconfig.h b/src/freetype/ftconfig.h index 9d5574b38..68d40ef6c 100644 --- a/src/freetype/ftconfig.h +++ b/src/freetype/ftconfig.h @@ -128,10 +128,7 @@ FT_BEGIN_HEADER #ifdef ECANCELED /* defined since 10.2 */ #include "AvailabilityMacros.h" #endif -#if defined( __LP64__ ) && \ - ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) -#undef FT_MACINTOSH -#endif +#define FT_MACINTOSH 1 #elif defined( __SC__ ) || defined( __MRC__ ) /* Classic MacOS compilers */ diff --git a/src/freetype/ftmac.c b/src/freetype/ftmac.c index c6847c6f1..a186761c5 100644 --- a/src/freetype/ftmac.c +++ b/src/freetype/ftmac.c @@ -987,7 +987,7 @@ return error; /* let it fall through to normal loader (.ttf, .otf, etc.) */ - return FT_Open_Face( library, &args, face_index, aface ); + return FT_Open_Face( library, args, face_index, aface ); } diff --git a/src/freetype/ftobjs.c b/src/freetype/ftobjs.c index e3bd6241f..2c4c0f5fa 100644 --- a/src/freetype/ftobjs.c +++ b/src/freetype/ftobjs.c @@ -2221,7 +2221,6 @@ FT_Error error; FT_UNUSED( args ); - error = IsMacBinary( library, stream, face_index, aface ); if ( FT_ERR_EQ( error, Unknown_File_Format ) ) { @@ -2258,6 +2257,7 @@ /* documentation is in freetype.h */ +#ifndef FT_MACINTOSH FT_EXPORT_DEF( FT_Error ) FT_New_Face( FT_Library library, const FT_Open_Args* args, @@ -2266,6 +2266,7 @@ { return FT_Open_Face( library, args, face_index, aface ); } +#endif FT_EXPORT_DEF( FT_Error ) FT_Open_Face( FT_Library library,