michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftmac.h */ michael@0: /* */ michael@0: /* Additional Mac-specific API. */ michael@0: /* */ michael@0: /* Copyright 1996-2001, 2004, 2006, 2007, 2013 by */ michael@0: /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* NOTE: Include this file after FT_FREETYPE_H and after any */ michael@0: /* Mac-specific headers (because this header uses Mac types such as */ michael@0: /* Handle, FSSpec, FSRef, etc.) */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FTMAC_H__ michael@0: #define __FTMAC_H__ michael@0: michael@0: michael@0: #include michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: michael@0: /* gcc-3.4.1 and later can warn about functions tagged as deprecated */ michael@0: #ifndef FT_DEPRECATED_ATTRIBUTE michael@0: #if defined(__GNUC__) && \ michael@0: ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) michael@0: #define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) michael@0: #else michael@0: #define FT_DEPRECATED_ATTRIBUTE michael@0: #endif michael@0: #endif michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /*
*/ michael@0: /* mac_specific */ michael@0: /* */ michael@0: /* */ michael@0: /* Mac Specific Interface */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* Only available on the Macintosh. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* The following definitions are only available if FreeType is */ michael@0: /* compiled on a Macintosh. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_New_Face_From_FOND */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Create a new face object from a FOND resource. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* fond :: A FOND resource. */ michael@0: /* */ michael@0: /* face_index :: Only supported for the -1 `sanity check' special */ michael@0: /* case. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Notes> */ michael@0: /* This function can be used to create @FT_Face objects from fonts */ michael@0: /* that are installed in the system as follows. */ michael@0: /* */ michael@0: /* { */ michael@0: /* fond = GetResource( 'FOND', fontName ); */ michael@0: /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ michael@0: /* } */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_New_Face_From_FOND( FT_Library library, michael@0: Handle fond, michael@0: FT_Long face_index, michael@0: FT_Face *aface ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_GetFile_From_Mac_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return an FSSpec for the disk file containing the named font. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* fontName :: Mac OS name of the font (e.g., Times New Roman */ michael@0: /* Bold). */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* pathSpec :: FSSpec to the file. For passing to */ michael@0: /* @FT_New_Face_From_FSSpec. */ michael@0: /* */ michael@0: /* face_index :: Index of the face. For passing to */ michael@0: /* @FT_New_Face_From_FSSpec. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_GetFile_From_Mac_Name( const char* fontName, michael@0: FSSpec* pathSpec, michael@0: FT_Long* face_index ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_GetFile_From_Mac_ATS_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return an FSSpec for the disk file containing the named font. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* fontName :: Mac OS name of the font in ATS framework. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* pathSpec :: FSSpec to the file. For passing to */ michael@0: /* @FT_New_Face_From_FSSpec. */ michael@0: /* */ michael@0: /* face_index :: Index of the face. For passing to */ michael@0: /* @FT_New_Face_From_FSSpec. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_GetFile_From_Mac_ATS_Name( const char* fontName, michael@0: FSSpec* pathSpec, michael@0: FT_Long* face_index ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_GetFilePath_From_Mac_ATS_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return a pathname of the disk file and face index for given font */ michael@0: /* name that is handled by ATS framework. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* fontName :: Mac OS name of the font in ATS framework. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* path :: Buffer to store pathname of the file. For passing */ michael@0: /* to @FT_New_Face. The client must allocate this */ michael@0: /* buffer before calling this function. */ michael@0: /* */ michael@0: /* maxPathSize :: Lengths of the buffer `path' that client allocated. */ michael@0: /* */ michael@0: /* face_index :: Index of the face. For passing to @FT_New_Face. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, michael@0: UInt8* path, michael@0: UInt32 maxPathSize, michael@0: FT_Long* face_index ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_New_Face_From_FSSpec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Create a new face object from a given resource and typeface index */ michael@0: /* using an FSSpec to the font file. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* spec :: FSSpec to the font file. */ michael@0: /* */ michael@0: /* face_index :: The index of the face within the resource. The */ michael@0: /* first face has index~0. */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ michael@0: /* it accepts an FSSpec instead of a path. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_New_Face_From_FSSpec( FT_Library library, michael@0: const FSSpec *spec, michael@0: FT_Long face_index, michael@0: FT_Face *aface ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_New_Face_From_FSRef */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Create a new face object from a given resource and typeface index */ michael@0: /* using an FSRef to the font file. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* spec :: FSRef to the font file. */ michael@0: /* */ michael@0: /* face_index :: The index of the face within the resource. The */ michael@0: /* first face has index~0. */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ michael@0: /* it accepts an FSRef instead of a path. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_New_Face_From_FSRef( FT_Library library, michael@0: const FSRef *ref, michael@0: FT_Long face_index, michael@0: FT_Face *aface ) michael@0: FT_DEPRECATED_ATTRIBUTE; michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: michael@0: #endif /* __FTMAC_H__ */ michael@0: michael@0: michael@0: /* END */