|
|
|
@ -19,36 +19,38 @@ |
|
|
|
|
/*
|
|
|
|
|
Notes |
|
|
|
|
|
|
|
|
|
Mac suitcase files can (and often do!) contain multiple fonts. To |
|
|
|
|
Mac suitcase files can (and often do!) contain multiple fonts. To |
|
|
|
|
support this I use the face_index argument of FT_(Open|New)_Face() |
|
|
|
|
functions, and pretend the suitcase file is a collection. |
|
|
|
|
Warning: although the FOND driver sets face->num_faces field to the |
|
|
|
|
|
|
|
|
|
Warning: Although the FOND driver sets face->num_faces field to the |
|
|
|
|
number of available fonts, but the Type 1 driver sets it to 1 anyway. |
|
|
|
|
So this field is currently not reliable, and I don't see a clean way |
|
|
|
|
to resolve that. The face_index argument translates to |
|
|
|
|
to resolve that. The face_index argument translates to |
|
|
|
|
|
|
|
|
|
Get1IndResource( 'FOND', face_index + 1 ); |
|
|
|
|
|
|
|
|
|
so clients should figure out the resource index of the FOND. |
|
|
|
|
(I'll try to provide some example code for this at some point.) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Mac FOND support works roughly like this: |
|
|
|
|
|
|
|
|
|
- Check whether the offered stream points to a Mac suitcase file. |
|
|
|
|
This is done by checking the file type: it has to be 'FFIL' or 'tfil'. |
|
|
|
|
The stream that gets passed to our init_face() routine is a stdio |
|
|
|
|
stream, which isn't usable for us, since the FOND resources live |
|
|
|
|
in the resource fork. So we just grab the stream->pathname field. |
|
|
|
|
in the resource fork. So we just grab the stream->pathname field. |
|
|
|
|
|
|
|
|
|
- Read the FOND resource into memory, then check whether there is |
|
|
|
|
a TrueType font and/or (!) a Type 1 font available. |
|
|
|
|
a TrueType font and/or(!) a Type 1 font available. |
|
|
|
|
|
|
|
|
|
- If there is a Type 1 font available (as a separate 'LWFN' file), |
|
|
|
|
read its data into memory, massage it slightly so it becomes |
|
|
|
|
PFB data, wrap it into a memory stream, load the Type 1 driver |
|
|
|
|
and delegate the rest of the work to it by calling FT_Open_Face(). |
|
|
|
|
(XXX TODO: after this has been done, the kerning data from the FOND |
|
|
|
|
resource should be appended to the face: on the Mac there are usually |
|
|
|
|
no AFM files available. However, this is tricky since we need to map |
|
|
|
|
resource should be appended to the face: On the Mac there are usually |
|
|
|
|
no AFM files available. However, this is tricky since we need to map |
|
|
|
|
Mac char codes to ps glyph names to glyph ID's...) |
|
|
|
|
|
|
|
|
|
- If there is a TrueType font (an 'sfnt' resource), read it into |
|
|
|
@ -80,26 +82,25 @@ |
|
|
|
|
#define PREFER_LWFN 1 |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Quick'n'dirty Pascal string to C string converter.
|
|
|
|
|
Warning: this call is not thread safe! Use with caution. */ |
|
|
|
|
static char* |
|
|
|
|
p2c_str( unsigned char* pstr ) |
|
|
|
|
{ |
|
|
|
|
static char cstr[256]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ft_strncpy( cstr, (char*)pstr + 1, pstr[0] ); |
|
|
|
|
cstr[pstr[0]] = '\0'; |
|
|
|
|
return cstr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Given a pathname, fill in a file spec. */ |
|
|
|
|
static int |
|
|
|
|
file_spec_from_path( const char* pathname, |
|
|
|
|
FSSpec* spec ) |
|
|
|
|
{ |
|
|
|
|
#if TARGET_API_MAC_CARBON |
|
|
|
|
|
|
|
|
|
OSErr e; |
|
|
|
|
FSRef ref; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e = FSPathMakeRef( (UInt8 *)pathname, &ref, false /* not a directory */ ); |
|
|
|
|
if ( e == noErr ) |
|
|
|
|
e = FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL, spec, NULL ); |
|
|
|
|
|
|
|
|
|
return ( e == noErr ) ? 0 : (-1); |
|
|
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
Str255 p_path; |
|
|
|
|
FT_ULong path_len; |
|
|
|
|
|
|
|
|
@ -115,6 +116,8 @@ |
|
|
|
|
return -1; |
|
|
|
|
else |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -132,24 +135,21 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON |
|
|
|
|
|
|
|
|
|
/* is this a Mac OS X .dfont file */ |
|
|
|
|
static Boolean |
|
|
|
|
is_dfont( FSSpec* spec ) |
|
|
|
|
{ |
|
|
|
|
int nameLen = spec->name[0]; |
|
|
|
|
int nameLen = spec->name[0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( spec->name[nameLen - 5] == '.' && |
|
|
|
|
spec->name[nameLen - 4] == 'd' && |
|
|
|
|
spec->name[nameLen - 3] == 'f' && |
|
|
|
|
spec->name[nameLen - 2] == 'o' && |
|
|
|
|
spec->name[nameLen - 1] == 'n' && |
|
|
|
|
spec->name[nameLen ] == 't' ) |
|
|
|
|
return true; |
|
|
|
|
else |
|
|
|
|
return false; |
|
|
|
|
return nameLen >= 6 && |
|
|
|
|
!memcmp( spec->name + nameLen - 5, ".dfont", 6 ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Given a PostScript font name, create the Macintosh LWFN file name. */ |
|
|
|
|
static void |
|
|
|
@ -193,12 +193,12 @@ |
|
|
|
|
FCBPBRec pb; |
|
|
|
|
OSErr error; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pb.ioNamePtr = file_name; |
|
|
|
|
pb.ioVRefNum = 0; |
|
|
|
|
pb.ioRefNum = ref_num; |
|
|
|
|
pb.ioFCBIndx = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error = PBGetFCBInfoSync( &pb ); |
|
|
|
|
if ( error == noErr ) |
|
|
|
|
{ |
|
|
|
@ -280,7 +280,6 @@ |
|
|
|
|
unsigned char* p = (unsigned char*)fond_data; |
|
|
|
|
StyleTable* style; |
|
|
|
|
unsigned short string_count; |
|
|
|
|
unsigned char* name_table = 0; |
|
|
|
|
char ps_name[256]; |
|
|
|
|
unsigned char* names[64]; |
|
|
|
|
int i; |
|
|
|
@ -298,16 +297,43 @@ |
|
|
|
|
p += names[i][0]; |
|
|
|
|
p++; |
|
|
|
|
} |
|
|
|
|
ft_strcpy( ps_name, p2c_str( names[0] ) ); /* Family name */ |
|
|
|
|
|
|
|
|
|
if ( style->indexes[0] > 1 ) |
|
|
|
|
{ |
|
|
|
|
unsigned char* suffixes = names[style->indexes[0] - 1]; |
|
|
|
|
size_t ps_name_len = (size_t)names[0][0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ps_name_len != 0 ) |
|
|
|
|
{ |
|
|
|
|
memcpy(ps_name, names[0] + 1, ps_name_len); |
|
|
|
|
ps_name[ps_name_len] = 0; |
|
|
|
|
} |
|
|
|
|
if ( style->indexes[0] > 1 ) |
|
|
|
|
{ |
|
|
|
|
unsigned char* suffixes = names[style->indexes[0] - 1]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ( i = 1; i < suffixes[0]; i++ ) |
|
|
|
|
{ |
|
|
|
|
unsigned char* s; |
|
|
|
|
size_t j = suffixes[i] - 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( j < string_count && ( s = names[j] ) != NULL ) |
|
|
|
|
{ |
|
|
|
|
size_t s_len = (size_t)s[0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ( i = 1; i <= suffixes[0]; i++ ) |
|
|
|
|
strcat( ps_name, p2c_str( names[suffixes[i] - 1] ) ); |
|
|
|
|
if ( s_len != 0 && ps_name_len + s_len < sizeof ( ps_name ) ) |
|
|
|
|
{ |
|
|
|
|
memcpy( ps_name + ps_name_len, s + 1, s_len ); |
|
|
|
|
ps_name_len += s_len; |
|
|
|
|
ps_name[ps_name_len] = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
create_lwfn_name( ps_name, lwfn_file_name ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -326,7 +352,7 @@ |
|
|
|
|
{ |
|
|
|
|
FT_Error error = FT_Err_Ok; |
|
|
|
|
short res_ref, res_id; |
|
|
|
|
unsigned char *buffer, *p, *size_p; |
|
|
|
|
unsigned char *buffer, *p, *size_p = NULL; |
|
|
|
|
FT_ULong total_size = 0; |
|
|
|
|
FT_ULong post_size, pfb_chunk_size; |
|
|
|
|
Handle post_data; |
|
|
|
@ -340,7 +366,7 @@ |
|
|
|
|
|
|
|
|
|
/* First pass: load all POST resources, and determine the size of
|
|
|
|
|
the output buffer. */ |
|
|
|
|
res_id = 501; |
|
|
|
|
res_id = 501; |
|
|
|
|
last_code = -1; |
|
|
|
|
|
|
|
|
|
for (;;) |
|
|
|
@ -368,9 +394,9 @@ |
|
|
|
|
|
|
|
|
|
/* Second pass: append all POST data to the buffer, add PFB fields.
|
|
|
|
|
Glue all consecutive chunks of the same type together. */ |
|
|
|
|
p = buffer; |
|
|
|
|
res_id = 501; |
|
|
|
|
last_code = -1; |
|
|
|
|
p = buffer; |
|
|
|
|
res_id = 501; |
|
|
|
|
last_code = -1; |
|
|
|
|
pfb_chunk_size = 0; |
|
|
|
|
|
|
|
|
|
for (;;) |
|
|
|
@ -387,10 +413,13 @@ |
|
|
|
|
if ( last_code != -1 ) |
|
|
|
|
{ |
|
|
|
|
/* we're done adding a chunk, fill in the size field */ |
|
|
|
|
*size_p++ = (FT_Byte)( pfb_chunk_size & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8 ) & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 16 ) & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 24 ) & 0xFF ); |
|
|
|
|
if ( size_p != NULL ) |
|
|
|
|
{ |
|
|
|
|
*size_p++ = (FT_Byte)( pfb_chunk_size & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8 ) & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 16 ) & 0xFF ); |
|
|
|
|
*size_p++ = (FT_Byte)( ( pfb_chunk_size >> 24 ) & 0xFF ); |
|
|
|
|
} |
|
|
|
|
pfb_chunk_size = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -442,39 +471,36 @@ |
|
|
|
|
|
|
|
|
|
/* Create a new memory stream from a buffer and a size. */ |
|
|
|
|
static FT_Error |
|
|
|
|
new_memory_stream( FT_Library library, |
|
|
|
|
FT_Byte* base, |
|
|
|
|
FT_ULong size, |
|
|
|
|
FT_Stream_Close close, |
|
|
|
|
FT_Stream* astream ) |
|
|
|
|
new_memory_stream( FT_Library library, |
|
|
|
|
FT_Byte* base, |
|
|
|
|
FT_ULong size, |
|
|
|
|
FT_Stream_CloseFunc close, |
|
|
|
|
FT_Stream *astream ) |
|
|
|
|
{ |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Memory memory; |
|
|
|
|
FT_Stream stream; |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Memory memory; |
|
|
|
|
FT_Stream stream; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !library ) |
|
|
|
|
return FT_Err_Invalid_Library_Handle; |
|
|
|
|
if ( !library ) |
|
|
|
|
return FT_Err_Invalid_Library_Handle; |
|
|
|
|
|
|
|
|
|
if ( !base ) |
|
|
|
|
return FT_Err_Invalid_Argument; |
|
|
|
|
if ( !base ) |
|
|
|
|
return FT_Err_Invalid_Argument; |
|
|
|
|
|
|
|
|
|
*astream = 0; |
|
|
|
|
memory = library->memory; |
|
|
|
|
if ( FT_NEW( stream ) ) |
|
|
|
|
goto Exit; |
|
|
|
|
*astream = 0; |
|
|
|
|
memory = library->memory; |
|
|
|
|
if ( FT_NEW( stream ) ) |
|
|
|
|
goto Exit; |
|
|
|
|
|
|
|
|
|
FT_Stream_OpenMemory( library, |
|
|
|
|
base, |
|
|
|
|
size, |
|
|
|
|
stream ); |
|
|
|
|
FT_Stream_OpenMemory( stream, base, size ); |
|
|
|
|
|
|
|
|
|
stream->close = close; |
|
|
|
|
stream->close = close; |
|
|
|
|
|
|
|
|
|
*astream = stream; |
|
|
|
|
*astream = stream; |
|
|
|
|
|
|
|
|
|
Exit: |
|
|
|
|
return error; |
|
|
|
|
Exit: |
|
|
|
|
return error; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -485,7 +511,7 @@ |
|
|
|
|
FT_ULong size, |
|
|
|
|
FT_Long face_index, |
|
|
|
|
char* driver_name, |
|
|
|
|
FT_Face* aface ) |
|
|
|
|
FT_Face *aface ) |
|
|
|
|
{ |
|
|
|
|
FT_Open_Args args; |
|
|
|
|
FT_Error error; |
|
|
|
@ -517,9 +543,10 @@ |
|
|
|
|
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
FT_Stream_Close( stream ); |
|
|
|
|
FT_Stream_CloseFunc( stream ); |
|
|
|
|
FT_FREE( stream ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return error; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -529,35 +556,17 @@ |
|
|
|
|
FT_New_Face_From_LWFN( FT_Library library, |
|
|
|
|
FSSpec* spec, |
|
|
|
|
FT_Long face_index, |
|
|
|
|
FT_Face* aface ) |
|
|
|
|
FT_Face *aface ) |
|
|
|
|
{ |
|
|
|
|
FT_Byte* pfb_data; |
|
|
|
|
FT_ULong pfb_size; |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Memory memory = library->memory; |
|
|
|
|
FT_Byte* pfb_data; |
|
|
|
|
FT_ULong pfb_size; |
|
|
|
|
FT_Error error; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error = read_lwfn( library->memory, spec, &pfb_data, &pfb_size ); |
|
|
|
|
if ( error ) |
|
|
|
|
return error; |
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
|
{ |
|
|
|
|
FILE* f; |
|
|
|
|
char* path; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path = p2c_str( spec->name ); |
|
|
|
|
strcat( path, ".PFB" ); |
|
|
|
|
f = fopen( path, "wb" ); |
|
|
|
|
if ( f ) |
|
|
|
|
{ |
|
|
|
|
fwrite( pfb_data, 1, pfb_size, f ); |
|
|
|
|
fclose( f ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
return open_face_from_buffer( library, |
|
|
|
|
pfb_data, |
|
|
|
|
pfb_size, |
|
|
|
@ -572,12 +581,11 @@ |
|
|
|
|
FT_New_Face_From_SFNT( FT_Library library, |
|
|
|
|
short sfnt_id, |
|
|
|
|
FT_Long face_index, |
|
|
|
|
FT_Face* aface ) |
|
|
|
|
FT_Face *aface ) |
|
|
|
|
{ |
|
|
|
|
Handle sfnt = NULL; |
|
|
|
|
FT_Byte* sfnt_data; |
|
|
|
|
size_t sfnt_size; |
|
|
|
|
FT_Stream stream = NULL; |
|
|
|
|
FT_Error error = 0; |
|
|
|
|
FT_Memory memory = library->memory; |
|
|
|
|
|
|
|
|
@ -612,7 +620,7 @@ |
|
|
|
|
FT_New_Face_From_Suitcase( FT_Library library, |
|
|
|
|
FSSpec* spec, |
|
|
|
|
FT_Long face_index, |
|
|
|
|
FT_Face* aface ) |
|
|
|
|
FT_Face *aface ) |
|
|
|
|
{ |
|
|
|
|
FT_Error error = FT_Err_Ok; |
|
|
|
|
short res_ref, res_index; |
|
|
|
@ -648,6 +656,8 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON |
|
|
|
|
|
|
|
|
|
/* Create a new FT_Face from a file spec to a suitcase file. */ |
|
|
|
|
static FT_Error |
|
|
|
|
FT_New_Face_From_dfont( FT_Library library, |
|
|
|
@ -694,8 +704,10 @@ |
|
|
|
|
return error; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* documentation in ftmac.h */ |
|
|
|
|
/* documentation is in ftmac.h */ |
|
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Error ) |
|
|
|
|
FT_New_Face_From_FOND( FT_Library library, |
|
|
|
@ -703,13 +715,12 @@ |
|
|
|
|
FT_Long face_index, |
|
|
|
|
FT_Face *aface ) |
|
|
|
|
{ |
|
|
|
|
short sfnt_id, have_sfnt, have_lwfn = 0; |
|
|
|
|
Str255 lwfn_file_name; |
|
|
|
|
short fond_id; |
|
|
|
|
OSType fond_type; |
|
|
|
|
Str255 fond_name; |
|
|
|
|
FSSpec lwfn_spec; |
|
|
|
|
FT_Error error = FT_Err_Unknown_File_Format; |
|
|
|
|
short sfnt_id, have_sfnt, have_lwfn = 0; |
|
|
|
|
Str255 lwfn_file_name; |
|
|
|
|
short fond_id; |
|
|
|
|
OSType fond_type; |
|
|
|
|
Str255 fond_name; |
|
|
|
|
FSSpec lwfn_spec; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetResInfo( fond, &fond_id, &fond_type, fond_name ); |
|
|
|
@ -743,7 +754,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* documentation in ftmac.h */ |
|
|
|
|
/* documentation is in ftmac.h */ |
|
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Error ) |
|
|
|
|
FT_GetFile_From_Mac_Name( char* fontName, |
|
|
|
@ -792,7 +803,7 @@ |
|
|
|
|
&style, &size ); |
|
|
|
|
if ( stat2 == 0 && size == 0 ) |
|
|
|
|
{ |
|
|
|
|
char fullName[256]; |
|
|
|
|
char fullName[256]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* build up a complete face name */ |
|
|
|
@ -829,6 +840,25 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static long |
|
|
|
|
ResourceForkSize(FSSpec* spec) |
|
|
|
|
{ |
|
|
|
|
long len; |
|
|
|
|
short refNum; |
|
|
|
|
OSErr e; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e = FSpOpenRF( spec, fsRdPerm, &refNum ); /* I.M. Files 2-155 */ |
|
|
|
|
if ( e == noErr ) |
|
|
|
|
{ |
|
|
|
|
e = GetEOF( refNum, &len ); |
|
|
|
|
FSClose( refNum ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( e == noErr ) ? len : 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* <Function> */ |
|
|
|
@ -858,20 +888,31 @@ |
|
|
|
|
if ( file_spec_from_path( pathname, &spec ) ) |
|
|
|
|
return FT_Err_Invalid_Argument; |
|
|
|
|
|
|
|
|
|
file_type = get_file_type( &spec ); |
|
|
|
|
if ( file_type == 'FFIL' || file_type == 'tfil' ) |
|
|
|
|
return FT_New_Face_From_Suitcase( library, &spec, face_index, aface ); |
|
|
|
|
else if ( file_type == 'LWFN' ) |
|
|
|
|
return FT_New_Face_From_LWFN( library, &spec, face_index, aface ); |
|
|
|
|
else if ( is_dfont( &spec ) ) |
|
|
|
|
return FT_New_Face_From_dfont( library, &spec, face_index, aface ); |
|
|
|
|
else /* let it fall through to normal loader (.ttf, .otf, etc.) */ |
|
|
|
|
/* Regardless of type, don't try to use the resource fork if it is */ |
|
|
|
|
/* empty. Some TTF fonts have type `FFIL', for example, but they */ |
|
|
|
|
/* only have data forks. */ |
|
|
|
|
|
|
|
|
|
if ( ResourceForkSize( &spec ) != 0 ) |
|
|
|
|
{ |
|
|
|
|
args.flags = ft_open_pathname; |
|
|
|
|
args.pathname = (char*)pathname; |
|
|
|
|
file_type = get_file_type( &spec ); |
|
|
|
|
if ( file_type == 'FFIL' || file_type == 'tfil' ) |
|
|
|
|
return FT_New_Face_From_Suitcase( library, &spec, face_index, aface ); |
|
|
|
|
|
|
|
|
|
return FT_Open_Face( library, &args, face_index, aface ); |
|
|
|
|
if ( file_type == 'LWFN' ) |
|
|
|
|
return FT_New_Face_From_LWFN( library, &spec, face_index, aface ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON |
|
|
|
|
|
|
|
|
|
if ( is_dfont( &spec ) ) |
|
|
|
|
return FT_New_Face_From_dfont( library, &spec, face_index, aface ); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* let it fall through to normal loader (.ttf, .otf, etc.) */ |
|
|
|
|
args.flags = ft_open_pathname; |
|
|
|
|
args.pathname = (char*)pathname; |
|
|
|
|
return FT_Open_Face( library, &args, face_index, aface ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|