sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
ftmac.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftmac.h
4 *
5 * Additional Mac-specific API.
6 *
7 * Copyright (C) 1996-2025 by
8 * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
9 *
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.
15 *
16 */
17
18
19/****************************************************************************
20 *
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.)
24 *
25 */
26
27
32#ifndef FTMAC_H_
33#define FTMAC_H_
34
35
36
37
38FT_BEGIN_HEADER
39
40
41 /* gcc-3.1 and later can warn about functions tagged as deprecated */
42#ifndef FT_DEPRECATED_ATTRIBUTE
43#if defined( __GNUC__ ) && \
44 ( ( __GNUC__ >= 4 ) || \
45 ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
46#define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
47#else
48#define FT_DEPRECATED_ATTRIBUTE
49#endif
50#endif
51
52
53 /**************************************************************************
54 *
55 * @section:
56 * mac_specific
57 *
58 * @title:
59 * Mac Specific Interface
60 *
61 * @abstract:
62 * Only available on the Macintosh.
63 *
64 * @description:
65 * The following definitions are only available if FreeType is compiled
66 * on a Macintosh.
67 *
68 */
69
70
71 /**************************************************************************
72 *
73 * @function:
74 * FT_New_Face_From_FOND
75 *
76 * @description:
77 * Create a new face object from a FOND resource.
78 *
79 * @inout:
80 * library ::
81 * A handle to the library resource.
82 *
83 * @input:
84 * fond ::
85 * A FOND resource.
86 *
87 * face_index ::
88 * Only supported for the -1 'sanity check' special case.
89 *
90 * @output:
91 * aface ::
92 * A handle to a new face object.
93 *
94 * @return:
95 * FreeType error code. 0~means success.
96 *
97 * @example:
98 * This function can be used to create @FT_Face objects from fonts that
99 * are installed in the system as follows.
100 *
101 * ```
102 * fond = GetResource( 'FOND', fontName );
103 * error = FT_New_Face_From_FOND( library, fond, 0, &face );
104 * ```
105 */
106 FT_EXPORT( FT_Error )
107 FT_New_Face_From_FOND( FT_Library library,
108 Handle fond,
109 FT_Long face_index,
110 FT_Face *aface )
111 FT_DEPRECATED_ATTRIBUTE;
112
113
114 /**************************************************************************
115 *
116 * @function:
117 * FT_GetFile_From_Mac_Name
118 *
119 * @description:
120 * Return an FSSpec for the disk file containing the named font.
121 *
122 * @input:
123 * fontName ::
124 * Mac OS name of the font (e.g., Times New Roman Bold).
125 *
126 * @output:
127 * pathSpec ::
128 * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
129 *
130 * face_index ::
131 * Index of the face. For passing to @FT_New_Face_From_FSSpec.
132 *
133 * @return:
134 * FreeType error code. 0~means success.
135 */
136 FT_EXPORT( FT_Error )
137 FT_GetFile_From_Mac_Name( const char* fontName,
138 FSSpec* pathSpec,
139 FT_Long* face_index )
140 FT_DEPRECATED_ATTRIBUTE;
141
142
143 /**************************************************************************
144 *
145 * @function:
146 * FT_GetFile_From_Mac_ATS_Name
147 *
148 * @description:
149 * Return an FSSpec for the disk file containing the named font.
150 *
151 * @input:
152 * fontName ::
153 * Mac OS name of the font in ATS framework.
154 *
155 * @output:
156 * pathSpec ::
157 * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
158 *
159 * face_index ::
160 * Index of the face. For passing to @FT_New_Face_From_FSSpec.
161 *
162 * @return:
163 * FreeType error code. 0~means success.
164 */
165 FT_EXPORT( FT_Error )
166 FT_GetFile_From_Mac_ATS_Name( const char* fontName,
167 FSSpec* pathSpec,
168 FT_Long* face_index )
169 FT_DEPRECATED_ATTRIBUTE;
170
171
172 /**************************************************************************
173 *
174 * @function:
175 * FT_GetFilePath_From_Mac_ATS_Name
176 *
177 * @description:
178 * Return a pathname of the disk file and face index for given font name
179 * that is handled by ATS framework.
180 *
181 * @input:
182 * fontName ::
183 * Mac OS name of the font in ATS framework.
184 *
185 * @output:
186 * path ::
187 * Buffer to store pathname of the file. For passing to @FT_New_Face.
188 * The client must allocate this buffer before calling this function.
189 *
190 * maxPathSize ::
191 * Lengths of the buffer `path` that client allocated.
192 *
193 * face_index ::
194 * Index of the face. For passing to @FT_New_Face.
195 *
196 * @return:
197 * FreeType error code. 0~means success.
198 */
199 FT_EXPORT( FT_Error )
200 FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
201 UInt8* path,
202 UInt32 maxPathSize,
203 FT_Long* face_index )
204 FT_DEPRECATED_ATTRIBUTE;
205
206
207 /**************************************************************************
208 *
209 * @function:
210 * FT_New_Face_From_FSSpec
211 *
212 * @description:
213 * Create a new face object from a given resource and typeface index
214 * using an FSSpec to the font file.
215 *
216 * @inout:
217 * library ::
218 * A handle to the library resource.
219 *
220 * @input:
221 * spec ::
222 * FSSpec to the font file.
223 *
224 * face_index ::
225 * The index of the face within the resource. The first face has
226 * index~0.
227 * @output:
228 * aface ::
229 * A handle to a new face object.
230 *
231 * @return:
232 * FreeType error code. 0~means success.
233 *
234 * @note:
235 * @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
236 * accepts an FSSpec instead of a path.
237 */
238 FT_EXPORT( FT_Error )
239 FT_New_Face_From_FSSpec( FT_Library library,
240 const FSSpec *spec,
241 FT_Long face_index,
242 FT_Face *aface )
243 FT_DEPRECATED_ATTRIBUTE;
244
245
246 /**************************************************************************
247 *
248 * @function:
249 * FT_New_Face_From_FSRef
250 *
251 * @description:
252 * Create a new face object from a given resource and typeface index
253 * using an FSRef to the font file.
254 *
255 * @inout:
256 * library ::
257 * A handle to the library resource.
258 *
259 * @input:
260 * spec ::
261 * FSRef to the font file.
262 *
263 * face_index ::
264 * The index of the face within the resource. The first face has
265 * index~0.
266 * @output:
267 * aface ::
268 * A handle to a new face object.
269 *
270 * @return:
271 * FreeType error code. 0~means success.
272 *
273 * @note:
274 * @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
275 * an FSRef instead of a path.
276 */
277 FT_EXPORT( FT_Error )
278 FT_New_Face_From_FSRef( FT_Library library,
279 const FSRef *ref,
280 FT_Long face_index,
281 FT_Face *aface )
282 FT_DEPRECATED_ATTRIBUTE;
283
284 /* */
285
286
287FT_END_HEADER
288
289
290#endif /* FTMAC_H_ */
291
292
293/* END */