1 /****************************************************************************
5 * Additional Mac-specific API.
7 * Copyright (C) 1996-2020 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.
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.)
37 /* gcc-3.1 and later can warn about functions tagged as deprecated */
38 #ifndef FT_DEPRECATED_ATTRIBUTE
39 #if defined( __GNUC__ ) && \
40 ( ( __GNUC__ >= 4 ) || \
41 ( ( __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 compiled
67 /**************************************************************************
70 * FT_New_Face_From_FOND
73 * Create a new face object from a FOND resource.
77 * A handle to the library resource.
84 * Only supported for the -1 'sanity check' special case.
88 * A handle to a new face object.
91 * FreeType error code. 0~means success.
94 * This function can be used to create @FT_Face objects from fonts that
95 * are installed in the system as follows.
98 * fond = GetResource( 'FOND', fontName );
99 * error = FT_New_Face_From_FOND( library, fond, 0, &face );
102 FT_EXPORT( FT_Error )
103 FT_New_Face_From_FOND( FT_Library library,
107 FT_DEPRECATED_ATTRIBUTE;
110 /**************************************************************************
113 * FT_GetFile_From_Mac_Name
116 * Return an FSSpec for the disk file containing the named font.
120 * Mac OS name of the font (e.g., Times New Roman Bold).
124 * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
127 * Index of the face. For passing to @FT_New_Face_From_FSSpec.
130 * FreeType error code. 0~means success.
132 FT_EXPORT( FT_Error )
133 FT_GetFile_From_Mac_Name( const char* fontName,
135 FT_Long* face_index )
136 FT_DEPRECATED_ATTRIBUTE;
139 /**************************************************************************
142 * FT_GetFile_From_Mac_ATS_Name
145 * Return an FSSpec for the disk file containing the named font.
149 * Mac OS name of the font in ATS framework.
153 * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
156 * Index of the face. For passing to @FT_New_Face_From_FSSpec.
159 * FreeType error code. 0~means success.
161 FT_EXPORT( FT_Error )
162 FT_GetFile_From_Mac_ATS_Name( const char* fontName,
164 FT_Long* face_index )
165 FT_DEPRECATED_ATTRIBUTE;
168 /**************************************************************************
171 * FT_GetFilePath_From_Mac_ATS_Name
174 * Return a pathname of the disk file and face index for given font name
175 * that is handled by ATS framework.
179 * Mac OS name of the font in ATS framework.
183 * Buffer to store pathname of the file. For passing to @FT_New_Face.
184 * The client must allocate this buffer before calling this function.
187 * Lengths of the buffer `path` that client allocated.
190 * Index of the face. For passing to @FT_New_Face.
193 * FreeType error code. 0~means success.
195 FT_EXPORT( FT_Error )
196 FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
199 FT_Long* face_index )
200 FT_DEPRECATED_ATTRIBUTE;
203 /**************************************************************************
206 * FT_New_Face_From_FSSpec
209 * Create a new face object from a given resource and typeface index
210 * using an FSSpec to the font file.
214 * A handle to the library resource.
218 * FSSpec to the font file.
221 * The index of the face within the resource. The first face has
225 * A handle to a new face object.
228 * FreeType error code. 0~means success.
231 * @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
232 * accepts an FSSpec instead of a path.
234 FT_EXPORT( FT_Error )
235 FT_New_Face_From_FSSpec( FT_Library library,
239 FT_DEPRECATED_ATTRIBUTE;
242 /**************************************************************************
245 * FT_New_Face_From_FSRef
248 * Create a new face object from a given resource and typeface index
249 * using an FSRef to the font file.
253 * A handle to the library resource.
257 * FSRef to the font file.
260 * The index of the face within the resource. The first face has
264 * A handle to a new face object.
267 * FreeType error code. 0~means success.
270 * @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
271 * an FSRef instead of a path.
273 FT_EXPORT( FT_Error )
274 FT_New_Face_From_FSRef( FT_Library library,
278 FT_DEPRECATED_ATTRIBUTE;
286 #endif /* FTMAC_H_ */