* src/base/ftmac.c: Use more abstract data type instead of `short\'
This commit is contained in:
parent
abc44f5ecf
commit
2be3f472dd
|
@ -1,3 +1,12 @@
|
||||||
|
2007-08-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
||||||
|
|
||||||
|
* src/base/ftmac.c: Introduction of abstract "short" data types,
|
||||||
|
ResFileRefNum and ResID. These types were introduced for Copland,
|
||||||
|
then backported to MPW. The variables exchanged with FileManager
|
||||||
|
QuickDraw frameworks are redefined by these data types. Patch was
|
||||||
|
proposed by Sean McBride.
|
||||||
|
* builds/mac/ftmac.c: Ditto.
|
||||||
|
|
||||||
2007-08-18 Werner Lemberg <wl@gnu.org>
|
2007-08-18 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs. Found
|
* src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs. Found
|
||||||
|
|
|
@ -360,7 +360,7 @@
|
||||||
#endif /* HAVE_ATS */
|
#endif /* HAVE_ATS */
|
||||||
|
|
||||||
|
|
||||||
#if !HAVE_FSSPEC
|
#if !HAVE_FSSPEC || !HAVE_ATS
|
||||||
|
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
|
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
|
||||||
|
@ -437,6 +437,7 @@
|
||||||
|
|
||||||
#if HAVE_FSSPEC && !HAVE_FSREF
|
#if HAVE_FSSPEC && !HAVE_FSREF
|
||||||
|
|
||||||
|
/* isDirectory is a dummy to synchronize API with FSPathMakeRef() */
|
||||||
static OSErr
|
static OSErr
|
||||||
FT_FSPathMakeSpec( const UInt8* pathname,
|
FT_FSPathMakeSpec( const UInt8* pathname,
|
||||||
FSSpec* spec_p,
|
FSSpec* spec_p,
|
||||||
|
@ -447,6 +448,7 @@
|
||||||
long dirID;
|
long dirID;
|
||||||
Str255 nodeName;
|
Str255 nodeName;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
|
FT_UNUSED( isDirectory );
|
||||||
|
|
||||||
|
|
||||||
p = q = (const char *)pathname;
|
p = q = (const char *)pathname;
|
||||||
|
@ -535,7 +537,7 @@
|
||||||
|
|
||||||
static OSErr
|
static OSErr
|
||||||
FT_FSPathMakeRes( const UInt8* pathname,
|
FT_FSPathMakeRes( const UInt8* pathname,
|
||||||
short* res )
|
ResFileRefNum* res )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if HAVE_FSREF
|
#if HAVE_FSREF
|
||||||
|
@ -690,7 +692,7 @@
|
||||||
static void
|
static void
|
||||||
parse_fond( char* fond_data,
|
parse_fond( char* fond_data,
|
||||||
short* have_sfnt,
|
short* have_sfnt,
|
||||||
short* sfnt_id,
|
ResID* sfnt_id,
|
||||||
Str255 lwfn_file_name,
|
Str255 lwfn_file_name,
|
||||||
short face_index )
|
short face_index )
|
||||||
{
|
{
|
||||||
|
@ -882,7 +884,7 @@
|
||||||
count_faces( Handle fond,
|
count_faces( Handle fond,
|
||||||
const UInt8* pathname )
|
const UInt8* pathname )
|
||||||
{
|
{
|
||||||
short sfnt_id;
|
ResID sfnt_id;
|
||||||
short have_sfnt, have_lwfn;
|
short have_sfnt, have_lwfn;
|
||||||
Str255 lwfn_file_name;
|
Str255 lwfn_file_name;
|
||||||
UInt8 buff[HFS_MAXPATHLEN];
|
UInt8 buff[HFS_MAXPATHLEN];
|
||||||
|
@ -920,12 +922,12 @@
|
||||||
of the same type together. */
|
of the same type together. */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
read_lwfn( FT_Memory memory,
|
read_lwfn( FT_Memory memory,
|
||||||
short res,
|
ResFileRefNum res,
|
||||||
FT_Byte** pfb_data,
|
FT_Byte** pfb_data,
|
||||||
FT_ULong* size )
|
FT_ULong* size )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
short res_id;
|
ResID res_id;
|
||||||
unsigned char *buffer, *p, *size_p = NULL;
|
unsigned char *buffer, *p, *size_p = NULL;
|
||||||
FT_ULong total_size = 0;
|
FT_ULong total_size = 0;
|
||||||
FT_ULong old_total_size = 0;
|
FT_ULong old_total_size = 0;
|
||||||
|
@ -1147,7 +1149,7 @@
|
||||||
FT_Byte* pfb_data;
|
FT_Byte* pfb_data;
|
||||||
FT_ULong pfb_size;
|
FT_ULong pfb_size;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
short res;
|
ResFileRefNum res;
|
||||||
|
|
||||||
|
|
||||||
if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
|
if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
|
||||||
|
@ -1172,7 +1174,7 @@
|
||||||
/* Create a new FT_Face from an SFNT resource, specified by res ID. */
|
/* Create a new FT_Face from an SFNT resource, specified by res ID. */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
FT_New_Face_From_SFNT( FT_Library library,
|
FT_New_Face_From_SFNT( FT_Library library,
|
||||||
short sfnt_id,
|
ResID sfnt_id,
|
||||||
FT_Long face_index,
|
FT_Long face_index,
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
|
@ -1222,7 +1224,8 @@
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Cannot_Open_Resource;
|
FT_Error error = FT_Err_Cannot_Open_Resource;
|
||||||
short res_ref, res_index;
|
ResFileRefNum res_ref;
|
||||||
|
short res_index;
|
||||||
Handle fond;
|
Handle fond;
|
||||||
short num_faces_in_res, num_faces_in_fond;
|
short num_faces_in_res, num_faces_in_fond;
|
||||||
|
|
||||||
|
@ -1265,8 +1268,8 @@
|
||||||
FT_Long face_index,
|
FT_Long face_index,
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
short sfnt_id, have_sfnt, have_lwfn = 0;
|
short have_sfnt, have_lwfn = 0;
|
||||||
short fond_id;
|
ResID sfnt_id, fond_id;
|
||||||
OSType fond_type;
|
OSType fond_type;
|
||||||
Str255 fond_name;
|
Str255 fond_name;
|
||||||
Str255 lwfn_file_name;
|
Str255 lwfn_file_name;
|
||||||
|
@ -1285,7 +1288,7 @@
|
||||||
|
|
||||||
if ( lwfn_file_name[0] )
|
if ( lwfn_file_name[0] )
|
||||||
{
|
{
|
||||||
short res;
|
ResFileRefNum res;
|
||||||
|
|
||||||
|
|
||||||
res = HomeResFile( fond );
|
res = HomeResFile( fond );
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* This function is deprecated because FSSpec is deprecated in Mac OS X */
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||||
FSSpec* pathSpec,
|
FSSpec* pathSpec,
|
||||||
|
@ -240,7 +241,7 @@
|
||||||
|
|
||||||
static OSErr
|
static OSErr
|
||||||
FT_FSPathMakeRes( const UInt8* pathname,
|
FT_FSPathMakeRes( const UInt8* pathname,
|
||||||
short* res )
|
ResFileRefNum* res )
|
||||||
{
|
{
|
||||||
OSErr err;
|
OSErr err;
|
||||||
FSRef ref;
|
FSRef ref;
|
||||||
|
@ -357,7 +358,7 @@
|
||||||
static void
|
static void
|
||||||
parse_fond( char* fond_data,
|
parse_fond( char* fond_data,
|
||||||
short* have_sfnt,
|
short* have_sfnt,
|
||||||
short* sfnt_id,
|
ResID* sfnt_id,
|
||||||
Str255 lwfn_file_name,
|
Str255 lwfn_file_name,
|
||||||
short face_index )
|
short face_index )
|
||||||
{
|
{
|
||||||
|
@ -464,7 +465,7 @@
|
||||||
size_t path_size )
|
size_t path_size )
|
||||||
{
|
{
|
||||||
FSRef ref, par_ref;
|
FSRef ref, par_ref;
|
||||||
int dirname_len;
|
size_t dirname_len;
|
||||||
|
|
||||||
|
|
||||||
/* Pathname for FSRef can be in various formats: HFS, HFS+, and POSIX. */
|
/* Pathname for FSRef can be in various formats: HFS, HFS+, and POSIX. */
|
||||||
|
@ -504,7 +505,7 @@
|
||||||
count_faces( Handle fond,
|
count_faces( Handle fond,
|
||||||
const UInt8* pathname )
|
const UInt8* pathname )
|
||||||
{
|
{
|
||||||
short sfnt_id;
|
ResID sfnt_id;
|
||||||
short have_sfnt, have_lwfn;
|
short have_sfnt, have_lwfn;
|
||||||
Str255 lwfn_file_name;
|
Str255 lwfn_file_name;
|
||||||
UInt8 buff[HFS_MAXPATHLEN];
|
UInt8 buff[HFS_MAXPATHLEN];
|
||||||
|
@ -540,12 +541,12 @@
|
||||||
of the same type together. */
|
of the same type together. */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
read_lwfn( FT_Memory memory,
|
read_lwfn( FT_Memory memory,
|
||||||
short res,
|
ResFileRefNum res,
|
||||||
FT_Byte** pfb_data,
|
FT_Byte** pfb_data,
|
||||||
FT_ULong* size )
|
FT_ULong* size )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
short res_id;
|
ResID res_id;
|
||||||
unsigned char *buffer, *p, *size_p = NULL;
|
unsigned char *buffer, *p, *size_p = NULL;
|
||||||
FT_ULong total_size = 0;
|
FT_ULong total_size = 0;
|
||||||
FT_ULong old_total_size = 0;
|
FT_ULong old_total_size = 0;
|
||||||
|
@ -767,7 +768,7 @@
|
||||||
FT_Byte* pfb_data;
|
FT_Byte* pfb_data;
|
||||||
FT_ULong pfb_size;
|
FT_ULong pfb_size;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
short res;
|
ResFileRefNum res;
|
||||||
|
|
||||||
|
|
||||||
if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
|
if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
|
||||||
|
@ -792,7 +793,7 @@
|
||||||
/* Create a new FT_Face from an SFNT resource, specified by res ID. */
|
/* Create a new FT_Face from an SFNT resource, specified by res ID. */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
FT_New_Face_From_SFNT( FT_Library library,
|
FT_New_Face_From_SFNT( FT_Library library,
|
||||||
short sfnt_id,
|
ResID sfnt_id,
|
||||||
FT_Long face_index,
|
FT_Long face_index,
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
|
@ -840,7 +841,8 @@
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Cannot_Open_Resource;
|
FT_Error error = FT_Err_Cannot_Open_Resource;
|
||||||
short res_ref, res_index;
|
ResFileRefNum res_ref;
|
||||||
|
short res_index;
|
||||||
Handle fond;
|
Handle fond;
|
||||||
short num_faces_in_res, num_faces_in_fond;
|
short num_faces_in_res, num_faces_in_fond;
|
||||||
|
|
||||||
|
@ -883,8 +885,8 @@
|
||||||
FT_Long face_index,
|
FT_Long face_index,
|
||||||
FT_Face* aface )
|
FT_Face* aface )
|
||||||
{
|
{
|
||||||
short sfnt_id, have_sfnt, have_lwfn = 0;
|
short have_sfnt, have_lwfn = 0;
|
||||||
short fond_id;
|
ResID sfnt_id, fond_id;
|
||||||
OSType fond_type;
|
OSType fond_type;
|
||||||
Str255 fond_name;
|
Str255 fond_name;
|
||||||
Str255 lwfn_file_name;
|
Str255 lwfn_file_name;
|
||||||
|
@ -901,7 +903,7 @@
|
||||||
|
|
||||||
if ( lwfn_file_name[0] )
|
if ( lwfn_file_name[0] )
|
||||||
{
|
{
|
||||||
short res;
|
ResFileRefNum res;
|
||||||
|
|
||||||
|
|
||||||
res = HomeResFile( fond );
|
res = HomeResFile( fond );
|
||||||
|
@ -1068,6 +1070,7 @@
|
||||||
/* FT_New_Face_From_FSSpec is identical to FT_New_Face except it */
|
/* FT_New_Face_From_FSSpec is identical to FT_New_Face except it */
|
||||||
/* accepts an FSSpec instead of a path. */
|
/* accepts an FSSpec instead of a path. */
|
||||||
/* */
|
/* */
|
||||||
|
/* This function is deprecated because FSSpec is deprecated in Mac OS X */
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error )
|
||||||
FT_New_Face_From_FSSpec( FT_Library library,
|
FT_New_Face_From_FSSpec( FT_Library library,
|
||||||
const FSSpec* spec,
|
const FSSpec* spec,
|
||||||
|
|
Loading…
Reference in New Issue