1 /***************************************************************************/
5 /* Additional Mac-specific API. */
7 /* Copyright 1996-2018 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 FT_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.1 and later can warn about functions tagged as deprecated */
39 #ifndef FT_DEPRECATED_ATTRIBUTE
40 #if defined( __GNUC__ ) && \
41 ( ( __GNUC__ >= 4 ) || \
42 ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
43 #define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
45 #define FT_DEPRECATED_ATTRIBUTE
50 /*************************************************************************/
56 /* Mac Specific Interface */
59 /* Only available on the Macintosh. */
62 /* The following definitions are only available if FreeType is */
63 /* compiled on a Macintosh. */
65 /*************************************************************************/
68 /*************************************************************************/
71 /* FT_New_Face_From_FOND */
74 /* Create a new face object from a FOND resource. */
77 /* library :: A handle to the library resource. */
80 /* fond :: A FOND resource. */
82 /* face_index :: Only supported for the -1 `sanity check' special */
86 /* aface :: A handle to a new face object. */
89 /* FreeType error code. 0~means success. */
92 /* This function can be used to create @FT_Face objects from fonts */
93 /* that are installed in the system as follows. */
96 /* fond = GetResource( 'FOND', fontName ); */
97 /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
100 FT_EXPORT( FT_Error
)
101 FT_New_Face_From_FOND( FT_Library library
,
105 FT_DEPRECATED_ATTRIBUTE
;
108 /*************************************************************************/
111 /* FT_GetFile_From_Mac_Name */
114 /* Return an FSSpec for the disk file containing the named font. */
117 /* fontName :: Mac OS name of the font (e.g., Times New Roman */
121 /* pathSpec :: FSSpec to the file. For passing to */
122 /* @FT_New_Face_From_FSSpec. */
124 /* face_index :: Index of the face. For passing to */
125 /* @FT_New_Face_From_FSSpec. */
128 /* FreeType error code. 0~means success. */
130 FT_EXPORT( FT_Error
)
131 FT_GetFile_From_Mac_Name( const char* fontName
,
133 FT_Long
* face_index
)
134 FT_DEPRECATED_ATTRIBUTE
;
137 /*************************************************************************/
140 /* FT_GetFile_From_Mac_ATS_Name */
143 /* Return an FSSpec for the disk file containing the named font. */
146 /* fontName :: Mac OS name of the font in ATS framework. */
149 /* pathSpec :: FSSpec to the file. For passing to */
150 /* @FT_New_Face_From_FSSpec. */
152 /* face_index :: Index of the face. For passing to */
153 /* @FT_New_Face_From_FSSpec. */
156 /* FreeType error code. 0~means success. */
158 FT_EXPORT( FT_Error
)
159 FT_GetFile_From_Mac_ATS_Name( const char* fontName
,
161 FT_Long
* face_index
)
162 FT_DEPRECATED_ATTRIBUTE
;
165 /*************************************************************************/
168 /* FT_GetFilePath_From_Mac_ATS_Name */
171 /* Return a pathname of the disk file and face index for given font */
172 /* name that is handled by ATS framework. */
175 /* fontName :: Mac OS name of the font in ATS framework. */
178 /* path :: Buffer to store pathname of the file. For passing */
179 /* to @FT_New_Face. The client must allocate this */
180 /* buffer before calling this function. */
182 /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
184 /* face_index :: Index of the face. For passing to @FT_New_Face. */
187 /* FreeType error code. 0~means success. */
189 FT_EXPORT( FT_Error
)
190 FT_GetFilePath_From_Mac_ATS_Name( const char* fontName
,
193 FT_Long
* face_index
)
194 FT_DEPRECATED_ATTRIBUTE
;
197 /*************************************************************************/
200 /* FT_New_Face_From_FSSpec */
203 /* Create a new face object from a given resource and typeface index */
204 /* using an FSSpec to the font file. */
207 /* library :: A handle to the library resource. */
210 /* spec :: FSSpec to the font file. */
212 /* face_index :: The index of the face within the resource. The */
213 /* first face has index~0. */
215 /* aface :: A handle to a new face object. */
218 /* FreeType error code. 0~means success. */
221 /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
222 /* it accepts an FSSpec instead of a path. */
224 FT_EXPORT( FT_Error
)
225 FT_New_Face_From_FSSpec( FT_Library library
,
229 FT_DEPRECATED_ATTRIBUTE
;
232 /*************************************************************************/
235 /* FT_New_Face_From_FSRef */
238 /* Create a new face object from a given resource and typeface index */
239 /* using an FSRef to the font file. */
242 /* library :: A handle to the library resource. */
245 /* spec :: FSRef to the font file. */
247 /* face_index :: The index of the face within the resource. The */
248 /* first face has index~0. */
250 /* aface :: A handle to a new face object. */
253 /* FreeType error code. 0~means success. */
256 /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
257 /* it accepts an FSRef instead of a path. */
259 FT_EXPORT( FT_Error
)
260 FT_New_Face_From_FSRef( FT_Library library
,
264 FT_DEPRECATED_ATTRIBUTE
;
272 #endif /* FTMAC_H_ */