ftmac.c File Reference

#include <ft2build.h>
#include "ftbase.h"
#include <CoreServices/CoreServices.h>
#include <ApplicationServices/ApplicationServices.h>
#include <sys/syslimits.h>

Go to the source code of this file.

Defines

#define OS_INLINE   static __inline__
#define HAVE_TYPE_RESOURCE_INDEX   0
#define FT_DEPRECATED_ATTRIBUTE
#define kATSOptionFlagsUnRestrictedScope   kATSOptionFlagsDefault
#define PREFER_LWFN   1

Typedefs

typedef short ResourceIndex

Functions

 FT_GetFile_From_Mac_Name (const char *fontName, FSSpec *pathSpec, FT_Long *face_index)
static OSStatus FT_ATSFontGetFileReference (ATSFontRef ats_font_id, FSRef *ats_font_ref)
static FT_Error FT_GetFileRef_From_Mac_ATS_Name (const char *fontName, FSRef *ats_font_ref, FT_Long *face_index)
 FT_GetFilePath_From_Mac_ATS_Name (const char *fontName, UInt8 *path, UInt32 maxPathSize, FT_Long *face_index)
 FT_GetFile_From_Mac_ATS_Name (const char *fontName, FSSpec *pathSpec, FT_Long *face_index)
static OSErr FT_FSPathMakeRes (const UInt8 *pathname, ResFileRefNum *res)
static OSType get_file_type_from_path (const UInt8 *pathname)
static void create_lwfn_name (char *ps_name, Str255 lwfn_file_name)
static short count_faces_sfnt (char *fond_data)
static short count_faces_scalable (char *fond_data)
static void parse_fond (char *fond_data, short *have_sfnt, ResID *sfnt_id, Str255 lwfn_file_name, short face_index)
static FT_Error lookup_lwfn_by_fond (const UInt8 *path_fond, ConstStr255Param base_lwfn, UInt8 *path_lwfn, size_t path_size)
static short count_faces (Handle fond, const UInt8 *pathname)
static FT_Error read_lwfn (FT_Memory memory, ResFileRefNum res, FT_Byte **pfb_data, FT_ULong *size)
static FT_Error FT_New_Face_From_LWFN (FT_Library library, const UInt8 *pathname, FT_Long face_index, FT_Face *aface)
static FT_Error FT_New_Face_From_SFNT (FT_Library library, ResID sfnt_id, FT_Long face_index, FT_Face *aface)
static FT_Error FT_New_Face_From_Suitcase (FT_Library library, const UInt8 *pathname, FT_Long face_index, FT_Face *aface)
 FT_New_Face_From_FOND (FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface)
static FT_Error FT_New_Face_From_Resource (FT_Library library, const UInt8 *pathname, FT_Long face_index, FT_Face *aface)
 FT_New_Face (FT_Library library, const char *pathname, FT_Long face_index, FT_Face *aface)
 FT_New_Face_From_FSRef (FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface)
 FT_New_Face_From_FSSpec (FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface)


Define Documentation

#define FT_DEPRECATED_ATTRIBUTE

Definition at line 105 of file ftmac.c.

#define HAVE_TYPE_RESOURCE_INDEX   0

Definition at line 90 of file ftmac.c.

#define kATSOptionFlagsUnRestrictedScope   kATSOptionFlagsDefault

Definition at line 110 of file ftmac.c.

Referenced by FT_GetFileRef_From_Mac_ATS_Name().

#define OS_INLINE   static __inline__

Definition at line 80 of file ftmac.c.

#define PREFER_LWFN   1

Definition at line 118 of file ftmac.c.


Typedef Documentation

typedef short ResourceIndex

Definition at line 97 of file ftmac.c.


Function Documentation

static short count_faces ( Handle  fond,
const UInt8 *  pathname 
) [static]

Definition at line 539 of file ftmac.c.

References count_faces_scalable(), lookup_lwfn_by_fond(), parse_fond(), PATH_MAX, and PREFER_LWFN.

static short count_faces_scalable ( char *  fond_data  )  [static]

Definition at line 357 of file ftmac.c.

References i.

static short count_faces_sfnt ( char *  fond_data  )  [static]

Definition at line 346 of file ftmac.c.

static void create_lwfn_name ( char *  ps_name,
Str255  lwfn_file_name 
) [static]

Definition at line 316 of file ftmac.c.

References ft_isalnum, ft_isupper, max, and p.

static OSStatus FT_ATSFontGetFileReference ( ATSFontRef  ats_font_id,
FSRef *  ats_font_ref 
) [static]

Definition at line 142 of file ftmac.c.

References FT_UNUSED, noErr, and spec.

Referenced by FT_GetFileRef_From_Mac_ATS_Name().

static OSErr FT_FSPathMakeRes ( const UInt8 *  pathname,
ResFileRefNum *  res 
) [static]

Definition at line 272 of file ftmac.c.

References FALSE, noErr, and NULL.

FT_GetFile_From_Mac_ATS_Name ( const char *  fontName,
FSSpec *  pathSpec,
FT_Long face_index 
)

Definition at line 242 of file ftmac.c.

References FT_GetFileRef_From_Mac_ATS_Name(), FT_UNUSED, noErr, and NULL.

FT_GetFile_From_Mac_Name ( const char *  fontName,
FSSpec *  pathSpec,
FT_Long face_index 
)

Definition at line 124 of file ftmac.c.

References FT_UNUSED.

FT_GetFilePath_From_Mac_ATS_Name ( const char *  fontName,
UInt8 *  path,
UInt32  maxPathSize,
FT_Long face_index 
)

Definition at line 220 of file ftmac.c.

References FT_GetFileRef_From_Mac_ATS_Name(), FT_UNUSED, and noErr.

static FT_Error FT_GetFileRef_From_Mac_ATS_Name ( const char *  fontName,
FSRef *  ats_font_ref,
FT_Long face_index 
) [static]

Definition at line 174 of file ftmac.c.

References FT_ATSFontGetFileReference(), kATSOptionFlagsUnRestrictedScope, noErr, and NULL.

Referenced by FT_GetFile_From_Mac_ATS_Name(), and FT_GetFilePath_From_Mac_ATS_Name().

FT_New_Face ( FT_Library  library,
const char *  pathname,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 951 of file ftmac.c.

References error, FT_Open_Args_::flags, FT_New_Face_From_Resource(), FT_Open_Face(), FT_OPEN_PATHNAME, NULL, and FT_Open_Args_::pathname.

FT_New_Face_From_FOND ( FT_Library  library,
Handle  fond,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 838 of file ftmac.c.

References error, FT_MEM_SET, FT_New_Face_From_LWFN(), FT_New_Face_From_SFNT(), lookup_lwfn_by_fond(), noErr, NULL, parse_fond(), PATH_MAX, PREFER_LWFN, and TTAG_FOND.

FT_New_Face_From_FSRef ( FT_Library  library,
const FSRef *  ref,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 992 of file ftmac.c.

References error, FT_Open_Args_::flags, FT_New_Face_From_Resource(), FT_Open_Face(), FT_OPEN_PATHNAME, FT_UNUSED, NULL, PATH_MAX, and FT_Open_Args_::pathname.

FT_New_Face_From_FSSpec ( FT_Library  library,
const FSSpec *  spec,
FT_Long  face_index,
FT_Face aface 
)

Definition at line 1032 of file ftmac.c.

References error, FT_Open_Args_::flags, FT_New_Face_From_FSRef(), FT_New_Face_From_Resource(), FT_Open_Face(), FT_OPEN_PATHNAME, FT_UNUSED, noErr, NULL, PATH_MAX, and FT_Open_Args_::pathname.

static FT_Error FT_New_Face_From_LWFN ( FT_Library  library,
const UInt8 *  pathname,
FT_Long  face_index,
FT_Face aface 
) [static]

Definition at line 694 of file ftmac.c.

References error, FT_FSPathMakeRes(), FT_LibraryRec_::memory, noErr, NULL, open_face_from_buffer(), and read_lwfn().

static FT_Error FT_New_Face_From_Resource ( FT_Library  library,
const UInt8 *  pathname,
FT_Long  face_index,
FT_Face aface 
) [static]

Definition at line 910 of file ftmac.c.

References error, FT_New_Face_From_LWFN(), FT_New_Face_From_Suitcase(), get_file_type_from_path(), NULL, and TTAG_LWFN.

static FT_Error FT_New_Face_From_SFNT ( FT_Library  library,
ResID  sfnt_id,
FT_Long  face_index,
FT_Face aface 
) [static]

Definition at line 726 of file ftmac.c.

References error, FT_ALLOC, FT_FREE, ft_memcmp, ft_memcpy, FT_NEW, FT_Stream_Close(), FT_Stream_OpenMemory(), FT_LibraryRec_::memory, NULL, open_face_from_buffer(), open_face_PS_from_sfnt_stream(), size_t, PC3::stream(), and TTAG_sfnt.

static FT_Error FT_New_Face_From_Suitcase ( FT_Library  library,
const UInt8 *  pathname,
FT_Long  face_index,
FT_Face aface 
) [static]

Definition at line 793 of file ftmac.c.

References count_faces(), error, FT_FSPathMakeRes(), FT_New_Face_From_FOND(), noErr, NULL, and TTAG_FOND.

static OSType get_file_type_from_path ( const UInt8 *  pathname  )  [static]

Definition at line 297 of file ftmac.c.

References FALSE, info, noErr, and NULL.

static FT_Error lookup_lwfn_by_fond ( const UInt8 *  path_fond,
ConstStr255Param  base_lwfn,
UInt8 *  path_lwfn,
size_t  path_size 
) [static]

Definition at line 496 of file ftmac.c.

References FALSE, ft_strcat, ft_strlen, noErr, NULL, and size_t.

static void parse_fond ( char *  fond_data,
short have_sfnt,
ResID *  sfnt_id,
Str255  lwfn_file_name,
short  face_index 
) [static]

Definition at line 388 of file ftmac.c.

References count_faces_sfnt(), create_lwfn_name(), for(), ft_memcpy, FT_MIN, i, j, names, NULL, p, s, short, and size_t.

static FT_Error read_lwfn ( FT_Memory  memory,
ResFileRefNum  res,
FT_Byte **  pfb_data,
FT_ULong size 
) [static]

Definition at line 577 of file ftmac.c.

References buffer, Error, error, FT_ALLOC, ft_memcpy, NULL, p, TTAG_POST, and x03.


Generated on Tue Jul 5 15:58:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1