1 /***************************************************************************/
5 /* Additional Mac-specific API. */
7 /* Copyright 1996-2001, 2004, 2006, 2007 by */
8 /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
19 /***************************************************************************/
21 /* NOTE: Include this file after <freetype/freetype.h> and after any */
22 /* Mac-specific headers (because this header uses Mac types such as */
23 /* Handle, FSSpec, FSRef, etc.) */
25 /***************************************************************************/
38 /* gcc-3.4.1 and later can warn about functions tagged as deprecated */
39 #ifndef FT_DEPRECATED_ATTRIBUTE
40 #if defined(__GNUC__) && \
41 ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
42 #define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
44 #define FT_DEPRECATED_ATTRIBUTE
49 /*************************************************************************/
55 /* Mac Specific Interface */
58 /* Only available on the Macintosh. */
61 /* The following definitions are only available if FreeType is */
62 /* compiled on a Macintosh. */
64 /*************************************************************************/
67 /*************************************************************************/
70 /* FT_New_Face_From_FOND */
73 /* Create a new face object from a FOND resource. */
76 /* library :: A handle to the library resource. */
79 /* fond :: A FOND resource. */
81 /* face_index :: Only supported for the -1 `sanity check' special */
85 /* aface :: A handle to a new face object. */
88 /* FreeType error code. 0~means success. */
91 /* This function can be used to create @FT_Face objects from fonts */
92 /* that are installed in the system as follows. */
95 /* fond = GetResource( 'FOND', fontName ); */
96 /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
100 FT_New_Face_From_FOND( FT_Library library,
104 FT_DEPRECATED_ATTRIBUTE;
107 /*************************************************************************/
110 /* FT_GetFile_From_Mac_Name */
113 /* Return an FSSpec for the disk file containing the named font. */
116 /* fontName :: Mac OS name of the font (e.g., Times New Roman */
120 /* pathSpec :: FSSpec to the file. For passing to */
121 /* @FT_New_Face_From_FSSpec. */
123 /* face_index :: Index of the face. For passing to */
124 /* @FT_New_Face_From_FSSpec. */
127 /* FreeType error code. 0~means success. */
129 FT_EXPORT( FT_Error )
130 FT_GetFile_From_Mac_Name( const char* fontName,
132 FT_Long* face_index )
133 FT_DEPRECATED_ATTRIBUTE;
136 /*************************************************************************/
139 /* FT_GetFile_From_Mac_ATS_Name */
142 /* Return an FSSpec for the disk file containing the named font. */
145 /* fontName :: Mac OS name of the font in ATS framework. */
148 /* pathSpec :: FSSpec to the file. For passing to */
149 /* @FT_New_Face_From_FSSpec. */
151 /* face_index :: Index of the face. For passing to */
152 /* @FT_New_Face_From_FSSpec. */
155 /* FreeType error code. 0~means success. */
157 FT_EXPORT( FT_Error )
158 FT_GetFile_From_Mac_ATS_Name( const char* fontName,
160 FT_Long* face_index )
161 FT_DEPRECATED_ATTRIBUTE;
164 /*************************************************************************/
167 /* FT_GetFilePath_From_Mac_ATS_Name */
170 /* Return a pathname of the disk file and face index for given font */
171 /* name which is handled by ATS framework. */
174 /* fontName :: Mac OS name of the font in ATS framework. */
177 /* path :: Buffer to store pathname of the file. For passing */
178 /* to @FT_New_Face. The client must allocate this */
179 /* buffer before calling this function. */
181 /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
183 /* face_index :: Index of the face. For passing to @FT_New_Face. */
186 /* FreeType error code. 0~means success. */
188 FT_EXPORT( FT_Error )
189 FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
192 FT_Long* face_index )
193 FT_DEPRECATED_ATTRIBUTE;
196 /*************************************************************************/
199 /* FT_New_Face_From_FSSpec */
202 /* Create a new face object from a given resource and typeface index */
203 /* using an FSSpec to the font file. */
206 /* library :: A handle to the library resource. */
209 /* spec :: FSSpec to the font file. */
211 /* face_index :: The index of the face within the resource. The */
212 /* first face has index~0. */
214 /* aface :: A handle to a new face object. */
217 /* FreeType error code. 0~means success. */
220 /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
221 /* it accepts an FSSpec instead of a path. */
223 FT_EXPORT( FT_Error )
224 FT_New_Face_From_FSSpec( FT_Library library,
228 FT_DEPRECATED_ATTRIBUTE;
231 /*************************************************************************/
234 /* FT_New_Face_From_FSRef */
237 /* Create a new face object from a given resource and typeface index */
238 /* using an FSRef to the font file. */
241 /* library :: A handle to the library resource. */
244 /* spec :: FSRef to the font file. */
246 /* face_index :: The index of the face within the resource. The */
247 /* first face has index~0. */
249 /* aface :: A handle to a new face object. */
252 /* FreeType error code. 0~means success. */
255 /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
256 /* it accepts an FSRef instead of a path. */
258 FT_EXPORT( FT_Error )
259 FT_New_Face_From_FSRef( FT_Library library,
263 FT_DEPRECATED_ATTRIBUTE;
271 #endif /* __FTMAC_H__ */