ftmac.c File Reference

#include <ft2build.h>
#include "ftbase.h"
#include <Resources.h>
#include <Fonts.h>
#include <Endian.h>
#include <Errors.h>
#include <Files.h>
#include <TextUtils.h>

Go to the source code of this file.

Defines

#define PATH_MAX   1024
#define FT_DEPRECATED_ATTRIBUTE
#define HAVE_FSSPEC   0
#define HAVE_FSREF   0
#define HAVE_QUICKDRAW_CARBON   0
#define HAVE_ATS   0
#define HAVE_TYPE_RESOURCE_INDEX   0
#define PREFER_LWFN   1

Typedefs

typedef short ResourceIndex

Functions

 FT_GetFile_From_Mac_Name (const char *fontName, FSSpec *pathSpec, 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, int 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 99 of file ftmac.c.

#define HAVE_ATS   0

Definition at line 146 of file ftmac.c.

#define HAVE_FSREF   0

Definition at line 125 of file ftmac.c.

#define HAVE_FSSPEC   0

Definition at line 116 of file ftmac.c.

#define HAVE_QUICKDRAW_CARBON   0

Definition at line 134 of file ftmac.c.

#define HAVE_TYPE_RESOURCE_INDEX   0

Definition at line 157 of file ftmac.c.

#define PATH_MAX   1024

Definition at line 92 of file ftmac.c.

Referenced by asim_my_scandir_ext(), count_faces(), FT_New_Face_From_FOND(), FT_New_Face_From_FSRef(), and FT_New_Face_From_FSSpec().

#define PREFER_LWFN   1

Definition at line 171 of file ftmac.c.

Referenced by count_faces(), and FT_New_Face_From_FOND().


Typedef Documentation

typedef short ResourceIndex

Definition at line 164 of file ftmac.c.


Function Documentation

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

Definition at line 921 of file ftmac.c.

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

Referenced by FT_New_Face_From_Suitcase().

static short count_faces_scalable ( char *  fond_data  )  [static]

Definition at line 695 of file ftmac.c.

References i.

Referenced by count_faces().

static short count_faces_sfnt ( char *  fond_data  )  [static]

Definition at line 684 of file ftmac.c.

Referenced by parse_fond().

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

Definition at line 654 of file ftmac.c.

References ft_isalnum, ft_isupper, and max.

Referenced by parse_fond().

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

Definition at line 571 of file ftmac.c.

References FALSE, noErr, and NULL.

Referenced by FT_New_Face_From_LWFN(), and FT_New_Face_From_Suitcase().

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

Definition at line 398 of file ftmac.c.

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

Definition at line 178 of file ftmac.c.

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

Definition at line 357 of file ftmac.c.

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

Definition at line 1380 of file ftmac.c.

Referenced by ExecuteTest(), FTFace::FTFace(), open_freetype_font_int(), and TTF::SetTextFont().

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

Definition at line 1224 of file ftmac.c.

Referenced by FT_New_Face_From_Suitcase().

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

Definition at line 1421 of file ftmac.c.

Referenced by FT_New_Face_From_FSSpec().

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

Definition at line 1477 of file ftmac.c.

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 1078 of file ftmac.c.

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

Referenced by FT_New_Face_From_FOND(), and FT_New_Face_From_Resource().

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 1339 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.

Referenced by FT_New_Face(), FT_New_Face_From_FSRef(), and FT_New_Face_From_FSSpec().

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 1110 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.

Referenced by FT_New_Face_From_FOND().

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 1179 of file ftmac.c.

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

Referenced by FT_New_Face_From_Resource().

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

Definition at line 615 of file ftmac.c.

References FALSE, info, noErr, and NULL.

Referenced by FT_New_Face_From_Resource().

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

Definition at line 833 of file ftmac.c.

References FALSE, ft_strcat, ft_strcpy, ft_strlen, i, noErr, and NULL.

Referenced by count_faces(), and FT_New_Face_From_FOND().

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

Definition at line 725 of file ftmac.c.

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

Referenced by count_faces(), and FT_New_Face_From_FOND().

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

Definition at line 961 of file ftmac.c.

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

Referenced by FT_New_Face_From_LWFN().


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