1 {
2 File: QD/ATSUnicodeFonts.h
3
4 Contains: ATSUI font handling functions.
5
6 Version: Quickdraw-285~150
7
8 Copyright: � 2003-2008 by Apple Inc. all rights reserved.
9
10 Bugs?: For bug reports, consult the following page on
11 the World Wide Web:
12
13 http://bugs.freepascal.org
14
15 }
16 { Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, 2004 }
17 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
18 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
19 {
20 Modified for use with Free Pascal
21 Version 308
22 Please report any bugs to <gpc@microbizz.nl>
23 }
24
25 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
26 {$mode macpas}
27 {$modeswitch cblocks}
28 {$packenum 1}
29 {$macro on}
30 {$inline on}
31 {$calling mwpascal}
32
33 unit ATSUnicodeFonts;
34 interface
35 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
36 {$setc GAP_INTERFACES_VERSION := $0308}
37
38 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
39 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
40 {$endc}
41
42 {$ifc defined CPUPOWERPC and defined CPUI386}
43 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
44 {$endc}
45 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
46 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
47 {$endc}
48
49 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
50 {$setc __ppc__ := 1}
51 {$elsec}
52 {$setc __ppc__ := 0}
53 {$endc}
54 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
55 {$setc __ppc64__ := 1}
56 {$elsec}
57 {$setc __ppc64__ := 0}
58 {$endc}
59 {$ifc not defined __i386__ and defined CPUI386}
60 {$setc __i386__ := 1}
61 {$elsec}
62 {$setc __i386__ := 0}
63 {$endc}
64 {$ifc not defined __x86_64__ and defined CPUX86_64}
65 {$setc __x86_64__ := 1}
66 {$elsec}
67 {$setc __x86_64__ := 0}
68 {$endc}
69 {$ifc not defined __arm__ and defined CPUARM}
70 {$setc __arm__ := 1}
71 {$elsec}
72 {$setc __arm__ := 0}
73 {$endc}
74 {$ifc not defined __arm64__ and defined CPUAARCH64}
75 {$setc __arm64__ := 1}
76 {$elsec}
77 {$setc __arm64__ := 0}
78 {$endc}
79
80 {$ifc defined cpu64}
81 {$setc __LP64__ := 1}
82 {$elsec}
83 {$setc __LP64__ := 0}
84 {$endc}
85
86
87 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
88 {$error Conflicting definitions for __ppc__ and __i386__}
89 {$endc}
90
91 {$ifc defined __ppc__ and __ppc__}
92 {$setc TARGET_CPU_PPC := TRUE}
93 {$setc TARGET_CPU_PPC64 := FALSE}
94 {$setc TARGET_CPU_X86 := FALSE}
95 {$setc TARGET_CPU_X86_64 := FALSE}
96 {$setc TARGET_CPU_ARM := FALSE}
97 {$setc TARGET_CPU_ARM64 := FALSE}
98 {$setc TARGET_OS_MAC := TRUE}
99 {$setc TARGET_OS_IPHONE := FALSE}
100 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
101 {$setc TARGET_OS_EMBEDDED := FALSE}
102 {$elifc defined __ppc64__ and __ppc64__}
103 {$setc TARGET_CPU_PPC := FALSE}
104 {$setc TARGET_CPU_PPC64 := TRUE}
105 {$setc TARGET_CPU_X86 := FALSE}
106 {$setc TARGET_CPU_X86_64 := FALSE}
107 {$setc TARGET_CPU_ARM := FALSE}
108 {$setc TARGET_CPU_ARM64 := FALSE}
109 {$setc TARGET_OS_MAC := TRUE}
110 {$setc TARGET_OS_IPHONE := FALSE}
111 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
112 {$setc TARGET_OS_EMBEDDED := FALSE}
113 {$elifc defined __i386__ and __i386__}
114 {$setc TARGET_CPU_PPC := FALSE}
115 {$setc TARGET_CPU_PPC64 := FALSE}
116 {$setc TARGET_CPU_X86 := TRUE}
117 {$setc TARGET_CPU_X86_64 := FALSE}
118 {$setc TARGET_CPU_ARM := FALSE}
119 {$setc TARGET_CPU_ARM64 := FALSE}
120 {$ifc defined iphonesim}
121 {$setc TARGET_OS_MAC := FALSE}
122 {$setc TARGET_OS_IPHONE := TRUE}
123 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
124 {$elsec}
125 {$setc TARGET_OS_MAC := TRUE}
126 {$setc TARGET_OS_IPHONE := FALSE}
127 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
128 {$endc}
129 {$setc TARGET_OS_EMBEDDED := FALSE}
130 {$elifc defined __x86_64__ and __x86_64__}
131 {$setc TARGET_CPU_PPC := FALSE}
132 {$setc TARGET_CPU_PPC64 := FALSE}
133 {$setc TARGET_CPU_X86 := FALSE}
134 {$setc TARGET_CPU_X86_64 := TRUE}
135 {$setc TARGET_CPU_ARM := FALSE}
136 {$setc TARGET_CPU_ARM64 := FALSE}
137 {$ifc defined iphonesim}
138 {$setc TARGET_OS_MAC := FALSE}
139 {$setc TARGET_OS_IPHONE := TRUE}
140 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
141 {$elsec}
142 {$setc TARGET_OS_MAC := TRUE}
143 {$setc TARGET_OS_IPHONE := FALSE}
144 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
145 {$endc}
146 {$setc TARGET_OS_EMBEDDED := FALSE}
147 {$elifc defined __arm__ and __arm__}
148 {$setc TARGET_CPU_PPC := FALSE}
149 {$setc TARGET_CPU_PPC64 := FALSE}
150 {$setc TARGET_CPU_X86 := FALSE}
151 {$setc TARGET_CPU_X86_64 := FALSE}
152 {$setc TARGET_CPU_ARM := TRUE}
153 {$setc TARGET_CPU_ARM64 := FALSE}
154 {$setc TARGET_OS_MAC := FALSE}
155 {$setc TARGET_OS_IPHONE := TRUE}
156 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
157 {$setc TARGET_OS_EMBEDDED := TRUE}
158 {$elifc defined __arm64__ and __arm64__}
159 {$setc TARGET_CPU_PPC := FALSE}
160 {$setc TARGET_CPU_PPC64 := FALSE}
161 {$setc TARGET_CPU_X86 := FALSE}
162 {$setc TARGET_CPU_X86_64 := FALSE}
163 {$setc TARGET_CPU_ARM := FALSE}
164 {$setc TARGET_CPU_ARM64 := TRUE}
165 {$ifc defined ios}
166 {$setc TARGET_OS_MAC := FALSE}
167 {$setc TARGET_OS_IPHONE := TRUE}
168 {$setc TARGET_OS_EMBEDDED := TRUE}
169 {$elsec}
170 {$setc TARGET_OS_MAC := TRUE}
171 {$setc TARGET_OS_IPHONE := FALSE}
172 {$setc TARGET_OS_EMBEDDED := FALSE}
173 {$endc}
174 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
175 {$elsec}
176 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
177 {$endc}
178
179 {$ifc defined __LP64__ and __LP64__ }
180 {$setc TARGET_CPU_64 := TRUE}
181 {$elsec}
182 {$setc TARGET_CPU_64 := FALSE}
183 {$endc}
184
185 {$ifc defined FPC_BIG_ENDIAN}
186 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
187 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
188 {$elifc defined FPC_LITTLE_ENDIAN}
189 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
190 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
191 {$elsec}
192 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
193 {$endc}
194 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
195 {$setc CALL_NOT_IN_CARBON := FALSE}
196 {$setc OLDROUTINENAMES := FALSE}
197 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
198 {$setc OPAQUE_UPP_TYPES := TRUE}
199 {$setc OTCARBONAPPLICATION := TRUE}
200 {$setc OTKERNEL := FALSE}
201 {$setc PM_USE_SESSION_APIS := TRUE}
202 {$setc TARGET_API_MAC_CARBON := TRUE}
203 {$setc TARGET_API_MAC_OS8 := FALSE}
204 {$setc TARGET_API_MAC_OSX := TRUE}
205 {$setc TARGET_CARBON := TRUE}
206 {$setc TARGET_CPU_68K := FALSE}
207 {$setc TARGET_CPU_MIPS := FALSE}
208 {$setc TARGET_CPU_SPARC := FALSE}
209 {$setc TARGET_OS_UNIX := FALSE}
210 {$setc TARGET_OS_WIN32 := FALSE}
211 {$setc TARGET_RT_MAC_68881 := FALSE}
212 {$setc TARGET_RT_MAC_CFM := FALSE}
213 {$setc TARGET_RT_MAC_MACHO := TRUE}
214 {$setc TYPED_FUNCTION_POINTERS := TRUE}
215 {$setc TYPE_BOOL := FALSE}
216 {$setc TYPE_EXTENDED := FALSE}
217 {$setc TYPE_LONGLONG := TRUE}
218 uses MacTypes,ATSUnicodeTypes,SFNTTypes;
219 {$endc} {not MACOSALLINCLUDE}
220
221
222 {$ifc TARGET_OS_MAC}
223
224 {$ALIGN POWER}
225
226
227 { ---------------------------------------------------------------------------- }
228 { Font features }
229 { ---------------------------------------------------------------------------- }
230
231
232 {
233 * ATSUSetFontFeatures() *** DEPRECATED ***
234 *
235 * Deprecated:
236 * Use CTFontDescriptorCreateCopyWithFeature,
237 * CTFontDescriptorCreateWithAttributes instead.
238 *
239 * Summary:
240 * Sets font features in a style object.
241 *
242 * Discussion:
243 * This function enables you to set multiple font features for a
244 * style object. Any unset font features retain their font-defined
245 * default values. To set style attributes and font variations for a
246 * style object, call the functions ATSUSetAttributes and
247 * ATSUSetVariations, respectively. The constants that represent
248 * font feature types are defined in the header file
249 * SFNTLayoutTypes.h. When you use ATSUI to access and set font
250 * features, you must use the constants defined in this header file,
251 * which are described in "Inside Mac OS X: Rendering Unicode Text
252 * With ATSUI". As feature types can be added at any time, you
253 * should check Apple's font feature registry website for the most
254 * up-to-date list of font feature types and selectors:
255 * http://developer.apple.com/fonts/Registry/index.html.
256 *
257 * Parameters:
258 *
259 * iStyle:
260 * The style object for which to set font features.
261 *
262 * iFeatureCount:
263 * The number of font features to set. This value should
264 * correspond to the number of elements in the iType and iSelector
265 * arrays.
266 *
267 * iType:
268 * An array of feature types. Each element in the array must
269 * contain a valid feature type that corresponds to a feature
270 * selector in the iSelector array. To obtain the valid feature
271 * types for a font, call the function ATSUGetFontFeatureTypes .
272 *
273 * iSelector:
274 * An array of feature selectors. Each element in the array must
275 * contain a valid feature selector that corresponds to a feature
276 * type in the iType array. To obtain the valid feature selectors
277 * for a font, call the function ATSUGetFontFeatureSelectors .
278 *
279 * Result:
280 * On success, noErr is returned. See MacErrors.h for possible error
281 * codes.
282 *
283 * Availability:
284 * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
285 * CarbonLib: in CarbonLib 1.0 and later
286 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
287 }
ATSUSetFontFeaturesnull288 function ATSUSetFontFeatures( iStyle: ATSUStyle; iFeatureCount: ItemCount; {const} iType: {variable-size-array} ATSUFontFeatureTypePtr; {const} iSelector: {variable-size-array} ATSUFontFeatureSelectorPtr ): OSStatus; external name '_ATSUSetFontFeatures';
289 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
290
291
292 {$ifc not TARGET_CPU_64}
293 {
294 * ATSUGetFontFeature() *** DEPRECATED ***
295 *
296 * Deprecated:
297 * Use CTFontDescriptorCopyAttribute instead.
298 *
299 * Summary:
300 * Obtains the font feature corresponding to an index into an array
301 * of font features for a style object.
302 *
303 * Discussion:
304 * You might typically call ATSUGetFontFeature if you need to obtain
305 * one previously set feature after another within your program's
306 * processing loop. To obtain all previously set font features for a
307 * given style object, you can call the function
308 * ATSUGetAllFontFeatures. Before calling ATSUGetFontFeature, you
309 * should call the function ATSUGetAllFontFeatures to obtain a count
310 * of the font features that are set in the style object. You can
311 * then pass the index for the feature whose setting you want to
312 * obtain in the iTag and iMaximumValueSize parameters of
313 * ATSUGetFontFeature.
314 *
315 * Parameters:
316 *
317 * iStyle:
318 * The style you wish to obtain font feature information for.
319 *
320 * iFeatureIndex:
321 * An index into the array of font features for the style object.
322 * This index identifies the font feature to examine. Because this
323 * index is zero-based, you must pass a value between 0 and one
324 * less than the value produced in the oActualFeatureCount
325 * parameter of the function ATSUGetAllFontFeatures.
326 *
327 * oFeatureType:
328 * On return, the value identifies the font feature type
329 * corresponding to the index passed in the iFeatureIndex
330 * parameter. You must allocate space for ATSUGetFontFeature to
331 * store this value.
332 *
333 * oFeatureSelector:
334 * On return, the value identifies the font feature selector that
335 * corresponds to the feature type produced in the oFeatureType
336 * parameter. ou must allocate space for ATSUGetFontFeature to
337 * store this value.
338 *
339 * Result:
340 * On success, noErr is returned. See MacErrors.h for possible error
341 * codes.
342 *
343 * Availability:
344 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
345 * CarbonLib: in CarbonLib 1.0 and later
346 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
347 }
ATSUGetFontFeaturenull348 function ATSUGetFontFeature( iStyle: ATSUStyle; iFeatureIndex: ItemCount; oFeatureType: ATSUFontFeatureTypePtr; oFeatureSelector: ATSUFontFeatureSelectorPtr ): OSStatus; external name '_ATSUGetFontFeature';
349 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
350
351
352 {
353 * ATSUGetAllFontFeatures() *** DEPRECATED ***
354 *
355 * Deprecated:
356 * Use CTFontDescriptorCopyAttribute instead.
357 *
358 * Summary:
359 * Obtains the font features of a style object that are not at
360 * default settings.
361 *
362 * Discussion:
363 * The ATSUGetAllFontFeatures function obtains all of a style
364 * object's font features that are not at default settings. Font
365 * features are grouped into categories called feature types, within
366 * which individual feature selectors define particular feature
367 * settings. The arrays produced by ATSUGetAllFontFeatures contain
368 * constants identifying the object's font types and their
369 * corresponding font selectors. Typically you use the function
370 * ATSUGetAllFontFeatures by calling it twice, as follows: (1) Pass
371 * a reference to the style object to examine in the iStyle
372 * parameter, a valid pointer to an ItemCount value in the
373 * oActualFeatureCount parameter, NULL for the oFeatureType and
374 * oFeatureSelector parameters, and 0 for the iMaximumFeatureCount
375 * parameter. ATSUGetAllFontFeatures returns the size in the
376 * oActualFeatureCount parameter to use for the feature type and
377 * selector arrays. (2) Allocate enough space for arrays of the
378 * returned size, then call ATSUGetAllFontFeatures again, passing a
379 * pointer to the arrays in the oFeatureType and oFeatureSelector
380 * parameters. On return, the arrays contain the font feature types
381 * and selectors, respectively, for the style object.
382 *
383 * Parameters:
384 *
385 * iStyle:
386 * The style for which you wish to obtain font feature information.
387 *
388 * iMaximumFeatureCount:
389 * The maximum number of feature types and selectors to obtain for
390 * the style object. Typically, this is equivalent to the number
391 * of ATSUFontFeatureType and ATSUFontFeatureSelector values for
392 * which you have allocated memory in the oFeatureType and
393 * oFeatureSelector parameters, respectively. To determine this
394 * value, see the Discussion.
395 *
396 * oFeatureType:
397 * On return, the array contains constants identifying each type
398 * of font feature that is at a nondefault setting in the style
399 * object. If you are uncertain of how much memory to allocate for
400 * this array, see the Discussion.
401 *
402 * oFeatureSelector:
403 * On return, the array contains constants identifying the feature
404 * selectors that are at nondefault settings in the style object.
405 * Each selector determines the setting for a corresponding
406 * feature type produced in the oFeatureType parameter. If you are
407 * uncertain of how much memory to allocate for this array, see
408 * the Discussion.
409 *
410 * oActualFeatureCount:
411 * On return, the value specifies the actual number of font
412 * feature types and selectors in the style object. This may be
413 * greater than the value you specified in the
414 * iMaximumFeatureCount parameter.
415 *
416 * Result:
417 * On success, noErr is returned. See MacErrors.h for possible error
418 * codes.
419 *
420 * Availability:
421 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
422 * CarbonLib: in CarbonLib 1.0 and later
423 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
424 }
ATSUGetAllFontFeaturesnull425 function ATSUGetAllFontFeatures( iStyle: ATSUStyle; iMaximumFeatureCount: ItemCount; oFeatureType: {variable-size-array} ATSUFontFeatureTypePtr { can be NULL }; oFeatureSelector: {variable-size-array} ATSUFontFeatureSelectorPtr { can be NULL }; oActualFeatureCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetAllFontFeatures';
426 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
427
428
429 {
430 * ATSUClearFontFeatures() *** DEPRECATED ***
431 *
432 * Deprecated:
433 * Use CoreText API and CFRelease instead.
434 *
435 * Summary:
436 * Restores default settings to the specified font features of a
437 * style object.
438 *
439 * Discussion:
440 * This function removes those font features that are identified by
441 * the feature selector and type constants in the iSelector and
442 * iType arrays and replaces them with their font-defined default
443 * values. Note that if you pass ATSUClearFontFeatures a font
444 * feature and selector that are already at default settings, the
445 * function does not return an error. To restore default font
446 * variations to a style object, call the function
447 * ATSUClearFontVariations. To restore default style attributes to a
448 * style object, call ATSUClearAttributes. To restore all default
449 * settings to a style object (for font features, variations, and
450 * style attributes), call the function ATSUClearStyle.
451 *
452 * Parameters:
453 *
454 * iStyle:
455 * A style whose font features you wish to clear.
456 *
457 * iFeatureCount:
458 * The number of font features to restore to default settings.
459 * This value should correspond to the number of elements in the
460 * iType and iSelector arrays. To restore default settings to all
461 * the font features in the specified style object, pass the
462 * constant kATSUClearAll in this parameter. In this case, the
463 * values in the iType and iSelector parameters are ignored.
464 *
465 * iType:
466 * An array of feature types. Each value should identify a font
467 * feature to restore to its default setting. To obtain all
468 * previously set font features for a given style object, you can
469 * call the function ATSUGetAllFontFeatures. You may pass NULL for
470 * this parameter if you are passing kATSUClearAll for the
471 * iFeatureCount parameter.
472 *
473 * iSelector:
474 * An array of feature selectors. Each element in the array must
475 * contain a valid feature selector corresponding to a font
476 * feature you provide in the iType parameter. To obtain all
477 * previously set feature selectors for a given style object, you
478 * can call the function ATSUGetAllFontFeatures. You may pass NULL
479 * for this parameter if you are passing kATSUClearAll for the
480 * iFeatureCount parameter.
481 *
482 * Result:
483 * On success, noErr is returned. See MacErrors.h for possible error
484 * codes.
485 *
486 * Availability:
487 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
488 * CarbonLib: in CarbonLib 1.0 and later
489 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
490 }
ATSUClearFontFeaturesnull491 function ATSUClearFontFeatures( iStyle: ATSUStyle; iFeatureCount: ItemCount; {const} iType: {variable-size-array} ATSUFontFeatureTypePtr { can be NULL }; {const} iSelector: {variable-size-array} ATSUFontFeatureSelectorPtr { can be NULL } ): OSStatus; external name '_ATSUClearFontFeatures';
492 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
493
494
495 { ---------------------------------------------------------------------------- }
496 { Font variations }
497 { ---------------------------------------------------------------------------- }
498 {
499 * ATSUSetVariations() *** DEPRECATED ***
500 *
501 * Deprecated:
502 * Use CTFontDescriptorCreateCopyWithVariation,
503 * CTFontDescriptorCreateWithAttributes instead.
504 *
505 * Summary:
506 * Sets font variation axes and values in a style object.
507 *
508 * Discussion:
509 * If you supply font variation axes and values to the
510 * ATSUSetVariations function, you can change the appearance of a
511 * style object's font accordingly. You may specify any number of
512 * variation axes and values in a style object. Any of the font's
513 * variations that you do not set retain their font-defined default
514 * values. You can also use the ATSUSetVariations function to supply
515 * your own value within any variation axes defined for the font.
516 * However, if the font does not support the variation axis you
517 * specify, your custom variation has no visual effect. By calling
518 * the function ATSUGetIndFontVariation, you can obtain a variation
519 * axis and its maximum, minimum, and default values for a font.
520 *
521 * Parameters:
522 *
523 * iStyle:
524 * The style object for which to set font variation values.
525 *
526 * iVariationCount:
527 * The number of font variation values to set. This value should
528 * correspond to the number of elements in the iAxes and iValue
529 * arrays.
530 *
531 * iAxes:
532 * An array of font variation axes. Each element in the array must
533 * represent a valid variation axis tag that corresponds to a
534 * variation value in the iValue array. To obtain a valid
535 * variation axis tag for a font, you can call the functions
536 * ATSUGetIndFontVariation or ATSUGetFontInstance.
537 *
538 * iValue:
539 * An array of font variation values. Each element in the array
540 * must contain a value that is valid for the corresponding
541 * variation axis in the iAxes parameter. You can obtain a font's
542 * maximum, minimum, and default values for a given variation axis
543 * by calling the function ATSUGetIndFontVariation . You can
544 * obtain the font variation axis values for a font instance by
545 * calling ATSUGetFontInstance.
546 *
547 * Result:
548 * On success, noErr is returned. See MacErrors.h for possible error
549 * codes.
550 *
551 * Availability:
552 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
553 * CarbonLib: in CarbonLib 1.0 and later
554 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
555 }
ATSUSetVariationsnull556 function ATSUSetVariations( iStyle: ATSUStyle; iVariationCount: ItemCount; {const} iAxes: {variable-size-array} ATSUFontVariationAxisPtr; {const} iValue: {variable-size-array} ATSUFontVariationValuePtr ): OSStatus; external name '_ATSUSetVariations';
557 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
558
559
560 {
561 * ATSUGetFontVariationValue() *** DEPRECATED ***
562 *
563 * Deprecated:
564 * Use CTFontDescriptorCopyAttribute instead.
565 *
566 * Summary:
567 * Obtains the current value for a single font variation axis in a
568 * style object.
569 *
570 * Discussion:
571 * This function obtains the setting for a specified font variation
572 * axis in a style object. You might typically call
573 * ATSUGetFontVariationValue if you need to obtain one previously
574 * set variation axis value after another within your program's
575 * processing loop. To obtain all nondefault font variation axis
576 * values for a given style object, you can call the function
577 * ATSUGetAllFontVariations. Before calling
578 * ATSUGetFontVariationValue, call the function
579 * ATSUGetAllFontVariations to obtain the font variation axes that
580 * are set for the style object.
581 *
582 * Parameters:
583 *
584 * iStyle:
585 * The style for which you want to obtain a variation value.
586 *
587 * iFontVariationAxis:
588 * A tag specifying the style object's variation axis to examine.
589 * You can obtain a list of variation axis tags that are set to
590 * non-default values in a particular style object from the
591 * function ATSUGetAllFontVariations.
592 *
593 * oFontVariationValue:
594 * On return, ATSUGetFontVariationValue produces the currently set
595 * value for the style object's specified variation axis. If this
596 * value has not been set, ATSUGetFontVariationValue produces the
597 * font-defined default value.
598 *
599 * Result:
600 * On success, noErr is returned. See MacErrors.h for possible error
601 * codes.
602 *
603 * Availability:
604 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
605 * CarbonLib: in CarbonLib 1.0 and later
606 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
607 }
ATSUGetFontVariationValuenull608 function ATSUGetFontVariationValue( iStyle: ATSUStyle; iFontVariationAxis: ATSUFontVariationAxis; oFontVariationValue: ATSUFontVariationValuePtr ): OSStatus; external name '_ATSUGetFontVariationValue';
609 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
610
611
612 {
613 * ATSUGetAllFontVariations() *** DEPRECATED ***
614 *
615 * Deprecated:
616 * Use CTFontDescriptorCopyAttribute instead.
617 *
618 * Summary:
619 * Obtains a style object's font variation values that are not at
620 * default settings.
621 *
622 * Discussion:
623 * This function obtains all of a style object's font variation axes
624 * that are not at default settings, as well as the current values
625 * for the axes. Typically you use the function
626 * ATSUGetAllFontVariations by calling it twice, as follows: (1)
627 * Pass a reference to the style object to examine in the iStyle
628 * parameter, a pointer to an ItemCount value in the
629 * oActualVariationCount parameter, NULL for the oVariationAxes and
630 * oFontVariationValues parameters, and 0 for the iVariationCount
631 * parameter. ATSUGetAllFontVariations returns the size to use for
632 * the variation axes and value arrays in the oActualVariationCount
633 * parameter. (2) Allocate enough space for arrays of the returned
634 * size, then call ATSUGetAllFontVariations again, passing a pointer
635 * to the arrays in the oVariationAxes and oFontVariationValues
636 * parameters. On return, the arrays contain the font variation axes
637 * and their corresponding values, respectively, for the style
638 * object.
639 *
640 * Parameters:
641 *
642 * iStyle:
643 * A style for which you wish to obtain information about current
644 * variation settings.
645 *
646 * iVariationCount:
647 * The maximum number of font variation values to obtain for the
648 * style object. Typically, this is equivalent to the number of
649 * ATSUFontVariationAxis and ATSUFontVariationValue values for
650 * which you have allocated memory in the oVariationAxes and
651 * oFontVariationValues parameters, respectively. To determine
652 * this value, see the Discussion.
653 *
654 * oVariationAxes:
655 * On return, the array contains the current font variation values
656 * for the font variation axes produced in the oVariationAxes
657 * array. If you are uncertain of how much memory to allocate for
658 * this array, see the Discussion.
659 *
660 * oFontVariationValues:
661 * On return, the value specifies the actual number of nondefault
662 * font variation values in the style object. This may be greater
663 * than the value you passed in the iVariationCount parameter. If
664 * you are uncertain of how much memory to allocate for this
665 * array, see the Discussion.
666 *
667 * oActualVariationCount:
668 * On return, the value specifies the actual number of nondefault
669 * font variation values in the style object. This may be greater
670 * than the value you passed in the iVariationCount parameter.
671 *
672 * Result:
673 * On success, noErr is returned. See MacErrors.h for possible error
674 * codes.
675 *
676 * Availability:
677 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
678 * CarbonLib: in CarbonLib 1.0 and later
679 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
680 }
ATSUGetAllFontVariationsnull681 function ATSUGetAllFontVariations( iStyle: ATSUStyle; iVariationCount: ItemCount; oVariationAxes: {variable-size-array} ATSUFontVariationAxisPtr { can be NULL }; oFontVariationValues: {variable-size-array} ATSUFontVariationValuePtr { can be NULL }; oActualVariationCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetAllFontVariations';
682 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
683
684
685 {
686 * ATSUClearFontVariations() *** DEPRECATED ***
687 *
688 * Deprecated:
689 * Use CoreText API and CFRelease instead.
690 *
691 * Summary:
692 * Restores default values to the specified font variation axes of a
693 * style object.
694 *
695 * Discussion:
696 * The ATSUClearFontVariations function removes those font variation
697 * axis values identified by variation axis tags in the iAxis array
698 * and replaces them with their font-defined default values. You can
699 * remove unset font variation values from a style object without a
700 * function error. To restore default font features to a style
701 * object, call the function ATSUClearFontFeatures. To restore
702 * default style attributes, call ATSUClearAttributes. To restore
703 * all default settings to a style object (for font features,
704 * variations, and style attributes), call the function
705 * ATSUClearStyle.
706 *
707 * Parameters:
708 *
709 * iStyle:
710 * The style in which you wish to clear font variation settings.
711 *
712 * iAxisCount:
713 * The number of font variation axes to restore to default
714 * settings. This value should correspond to the number of
715 * elements in the iAxis array. To restore default values to all
716 * the font variation axes in the style object, pass the constant
717 * kATSUClearAll in this parameter. If you pass kATSUClearAll the
718 * value in the iAxis parameter is ignored.
719 *
720 * iAxis:
721 * An array of font variation axes. Each element in the array must
722 * contain a valid tag that corresponds to a font variation axis
723 * to restore to its default setting. You can obtain variation
724 * axis tags for a style object from the function
725 * ATSUGetAllFontVariations. You may pass NULL for this parameter
726 * if you are passing kATSUClearAll for the iAxisCount parameter.
727 *
728 * Result:
729 * On success, noErr is returned. See MacErrors.h for possible error
730 * codes.
731 *
732 * Availability:
733 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
734 * CarbonLib: in CarbonLib 1.0 and later
735 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
736 }
ATSUClearFontVariationsnull737 function ATSUClearFontVariations( iStyle: ATSUStyle; iAxisCount: ItemCount; {const} iAxis: {variable-size-array} ATSUFontVariationAxisPtr { can be NULL } ): OSStatus; external name '_ATSUClearFontVariations';
738 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
739
740
741 { ---------------------------------------------------------------------------- }
742 { Font ID's }
743 { ---------------------------------------------------------------------------- }
744 {
745 * ATSUFontCount() *** DEPRECATED ***
746 *
747 * Deprecated:
748 * Use CTFontCollectionCreateFromAvailableFonts instead.
749 *
750 * Summary:
751 * Obtains the number of ATSUI-compatible fonts installed on a
752 * user's system.
753 *
754 * Discussion:
755 * The ATSUFontCount function obtains the number of fonts on a
756 * user's system that are compatible with ATSUI. Incompatible fonts
757 * include those that cannot be used to represent Unicode, the
758 * missing-character glyph font, and fonts whose names begin with a
759 * period or a percent sign. You can use the count produced in the
760 * oFontCount parameter to determine the amount of memory to
761 * allocate for the oFontIDs array in the function ATSUGetFontIDs.
762 * It is important to note that the set of installed
763 * ATSUI-compatible fonts may change while your application is
764 * running. In Mac OS X, the set of installed fonts may change at
765 * any time. Although in Mac OS 9, fonts cannot be removed from the
766 * Fonts folder while an application other than the Finder is
767 * running, they can be removed from other locations, and it is
768 * possible for fonts to be added. Additionally, just because the
769 * number of fonts stays the same between two successive calls to
770 * ATSUFontCount , this does not mean that the font lists are the
771 * same. It is possible for a font to be added and another removed
772 * between two successive calls to ATSUFontCount , leaving the total
773 * number unchanged.
774 *
775 * Parameters:
776 *
777 * oFontCount:
778 * On return, the number of ATSUI-compatible fonts installed on a
779 * user's system.
780 *
781 * Result:
782 * On success, noErr is returned. See MacErrors.h for possible error
783 * codes.
784 *
785 * Availability:
786 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
787 * CarbonLib: in CarbonLib 1.0 and later
788 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
789 }
ATSUFontCountnull790 function ATSUFontCount( var oFontCount: ItemCount ): OSStatus; external name '_ATSUFontCount';
791 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
792
793
794 {
795 * ATSUGetFontIDs() *** DEPRECATED ***
796 *
797 * Deprecated:
798 * Use CTFontCollectionCreateFromAvailableFonts
799 * CTFontCollectionCreateWithFontDescriptors, or
800 * CTFontCollectionCreateCopyWithFontDescriptors instead.
801 *
802 * Summary:
803 * Obtains a list of all the ATSUI-compatible fonts installed on the
804 * user's system.
805 *
806 * Discussion:
807 * Use the function ATSUFontCount to determine how much memory to
808 * allocate before calling this function. Also see the discussion
809 * for the ATSUFontCount function.
810 *
811 * Parameters:
812 *
813 * oFontIDs:
814 * On return, the array contains unique identifiers for each of
815 * the ATSUI-compatible fonts installed on the user's system. You
816 * should allocate enough memory to contain an array the size of
817 * the count produced by the function ATSUFontCount.
818 *
819 * iArraySize:
820 * The maximum number of fonts to obtain. Typically, this is
821 * equivalent to the number of ATSUFontID values for which you
822 * have allocated memory in the oFontIDs parameter.
823 *
824 * oFontCount:
825 * On return, the value specifies the actual number of
826 * ATSUI-compatible fonts installed on the user's system. This may
827 * be greater than the value you specified in the iArraySize
828 * parameter.
829 *
830 * Result:
831 * On success, noErr is returned. See MacErrors.h for possible error
832 * codes.
833 *
834 * Availability:
835 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
836 * CarbonLib: in CarbonLib 1.0 and later
837 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
838 }
ATSUGetFontIDsnull839 function ATSUGetFontIDs( oFontIDs: {variable-size-array} ATSUFontIDPtr; iArraySize: ItemCount; oFontCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetFontIDs';
840 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
841
842
843 {
844 * ATSUFONDtoFontID() *** DEPRECATED ***
845 *
846 * Deprecated:
847 * Use CoreText API instead.
848 *
849 * Summary:
850 * Finds the ATSUI font ID that corresponds to a font family number,
851 * if one exists.
852 *
853 * Discussion:
854 * This function is not recommended. It is specifically associated
855 * with old QD data types (i.e. the QD font family or 'FOND'
856 * identifier) that has no equivalent in the newer API sets. The
857 * concept of FOND ID and font family instances are all QD-specific
858 * concepts that are not supported in Cocoa, Quartz, and the
859 * non-deprecated parts of ATS and ATSUI.
860 *
861 * Availability:
862 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
863 * CarbonLib: in CarbonLib 1.0 and later
864 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
865 }
ATSUFONDtoFontIDnull866 function ATSUFONDtoFontID( iFONDNumber: SInt16; iFONDStyle: Style; var oFontID: ATSUFontID ): OSStatus; external name '_ATSUFONDtoFontID';
867 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
868
869
870 {
871 * ATSUFontIDtoFOND() *** DEPRECATED ***
872 *
873 * Deprecated:
874 * Use CoreText API instead.
875 *
876 * Summary:
877 * Finds the font family number and style that correspond to an
878 * ATSUI font ID, if these exist.
879 *
880 * Discussion:
881 * This function is not recommended. It is specifically associated
882 * with old QD data types (i.e. the QD font family or 'FOND'
883 * identifier) that has no equivalent in the newer API sets. The
884 * concept of FOND ID and font family instances are all QD-specific
885 * concepts that are not supported in Cocoa, Quartz, and the
886 * non-deprecated parts of ATS and ATSUI.
887 *
888 * Availability:
889 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
890 * CarbonLib: in CarbonLib 1.0 and later
891 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
892 }
ATSUFontIDtoFONDnull893 function ATSUFontIDtoFOND( iFontID: ATSUFontID; var oFONDNumber: SInt16; var oFONDStyle: Style ): OSStatus; external name '_ATSUFontIDtoFOND';
894 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
895
896
897 { ---------------------------------------------------------------------------- }
898 { Font names }
899 { ---------------------------------------------------------------------------- }
900 {
901 * ATSUCountFontNames() *** DEPRECATED ***
902 *
903 * Deprecated:
904 * Use CTFontCopyPostScriptName, CTFontCopyFamilyName,
905 * CTFontCopyFullName, CTFontCopyDisplayName, CTFontCopyName, or
906 * CTFontCopyLocalizedName instead.
907 *
908 * Summary:
909 * Obtains the number of font names that correspond to a given ATSUI
910 * font ID.
911 *
912 * Discussion:
913 * This function obtains the number of font names defined in a font
914 * name table for a given ATSUI font ID. This number includes
915 * repetitions of the same name in different platforms, languages,
916 * and scripts; names of font features, variations, tracking
917 * settings, and instances for the font; and font names identified
918 * by name code constants. You can pass an index value based on this
919 * count to the function ATSUGetIndFontName to obtain a name string,
920 * name code, platform, script, and language for a given ATSUI font
921 * ID.
922 *
923 * Parameters:
924 *
925 * iFontID:
926 * The font for which you wish to obtain the font name count.
927 *
928 * oFontNameCount:
929 * On return, the value specifies the number of entries in the
930 * font name table corresponding to the given ATSUI font ID.
931 *
932 * Result:
933 * On success, noErr is returned. See MacErrors.h for possible error
934 * codes.
935 *
936 * Availability:
937 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
938 * CarbonLib: in CarbonLib 1.0 and later
939 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
940 }
ATSUCountFontNamesnull941 function ATSUCountFontNames( iFontID: ATSUFontID; var oFontNameCount: ItemCount ): OSStatus; external name '_ATSUCountFontNames';
942 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
943
944
945 {
946 * ATSUGetIndFontName() *** DEPRECATED ***
947 *
948 * Deprecated:
949 * Use CTFontCopyPostScriptName, CTFontCopyFamilyName,
950 * CTFontCopyFullName, CTFontCopyDisplayName, CTFontCopyName, or
951 * CTFontCopyLocalizedName instead.
952 *
953 * Summary:
954 * Obtains a name string, name code, platform, script, and language
955 * for the font that matches an ATSUI font ID and name table index
956 * value.
957 *
958 * Discussion:
959 * Typically you use the ATSUGetIndFontName function by calling it
960 * twice, as follows: (1) Pass valid values for the iFontID,
961 * iFontNameIndex, and oActualNameLength parameters, 0 for the
962 * iMaximumNameLength parameter, and NULL for the other parameters.
963 * ATSUGetIndFontName returns the length of the font name string in
964 * the oActualNameLength parameter. (2) Allocate enough space for a
965 * buffer of the returned size, then call the function again,
966 * passing a valid pointer to the buffer in the oName parameter. On
967 * return, the buffer contains the font name string. To find a name
968 * string and index value for the first font in a name table that
969 * matches an ATSUI font ID and the specified font parameters, call
970 * the function ATSUFindFontName. To obtain an ATSUI font ID for the
971 * first font in a name table that matches the specified name
972 * string, name code, platform, script, and/or language, call the
973 * function ATSUFindFontFromName.
974 *
975 * Parameters:
976 *
977 * iFontID:
978 * The font for which to obtain information. Note that because
979 * Apple Type Services assigns ATSUFontID values systemwide at
980 * runtime, font IDs can change across system restarts.
981 *
982 * iFontNameIndex:
983 * An index to the font for which to obtain information. Because
984 * this index must be 0-based, you should pass a value between 0
985 * and one less than the count produced by the function
986 * ATSUCountFontNames.
987 *
988 * iMaximumNameLength:
989 * The maximum length of the font name string to obtain.
990 * Typically, this is equivalent to the size of the buffer that
991 * you have allocated in the oName parameter. To determine this
992 * length, see the Discussion.
993 *
994 * oName:
995 * On return, the buffer contains the name string of the font
996 * matching the ATSUI font ID and name table index value being
997 * passed. If the buffer you allocate is not large enough to
998 * contain the name string, ATSUGetIndFontName produces a partial
999 * string. If you are unsure how much memory to allocate for this
1000 * parameter, see the Discussion.
1001 *
1002 * oActualNameLength:
1003 * On return, the value specifies the actual length of the
1004 * complete name string. This may be greater than the value passed
1005 * in the iMaximumNameLength parameter. You should check this
1006 * value to ensure that you have allocated sufficient memory and
1007 * therefore obtained the complete name string for the font.
1008 *
1009 * oFontNameCode:
1010 * On return, a value specifying the type of name returned (i.e.,
1011 * full name, postscript name) of the font. See SFNTTypes.h for a
1012 * list of possible values.
1013 *
1014 * oFontNamePlatform:
1015 * On return, a value specifying the encoding of the font. See
1016 * SFNTTypes.h for a list of possible values.
1017 *
1018 * oFontNameScript:
1019 * On return, a value specifying the script of the font. See
1020 * SFNTTypes.h for a list of possible values.
1021 *
1022 * oFontNameLanguage:
1023 * On return, a value specifying the language of the font. See
1024 * SFNTTypes.h for a list of possible values.
1025 *
1026 * Result:
1027 * On success, noErr is returned. See MacErrors.h for possible error
1028 * codes.
1029 *
1030 * Availability:
1031 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1032 * CarbonLib: in CarbonLib 1.0 and later
1033 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1034 }
ATSUGetIndFontNamenull1035 function ATSUGetIndFontName( iFontID: ATSUFontID; iFontNameIndex: ItemCount; iMaximumNameLength: ByteCount; oName: Ptr; oActualNameLength: ByteCountPtr { can be NULL }; oFontNameCode: FontNameCodePtr { can be NULL }; oFontNamePlatform: FontPlatformCodePtr { can be NULL }; oFontNameScript: FontScriptCodePtr { can be NULL }; oFontNameLanguage: FontLanguageCodePtr { can be NULL } ): OSStatus; external name '_ATSUGetIndFontName';
1036 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1037
1038
1039 {
1040 * ATSUFindFontName() *** DEPRECATED ***
1041 *
1042 * Deprecated:
1043 * Use CTFontCopyPostScriptName, CTFontCopyFamilyName,
1044 * CTFontCopyFullName, CTFontCopyDisplayName, CTFontCopyName, or
1045 * CTFontCopyLocalizedName instead.
1046 *
1047 * Summary:
1048 * Obtains a name string and index value for the first font in a
1049 * name table that matches the specified ATSUI font ID, name code,
1050 * platform, script, and/or language.
1051 *
1052 * Discussion:
1053 * Typically you use the ATSUFindFontName function by calling it
1054 * twice, as follows: (1) Pass NULL for the oName and oFontNameIndex
1055 * parameters, 0 for the iMaximumNameLength parameter, and valid
1056 * values for the other parameters. ATSUFindFontName returns the
1057 * length of the font name string in the oActualNameLength
1058 * parameter. (2) Allocate enough space for a buffer of the returned
1059 * size, then call the function again, passing a valid pointer to
1060 * the buffer in the oName parameter. On return, the buffer contains
1061 * the font name string. To obtain an ATSUI font ID for the first
1062 * font in a name table that matches the specified name string, name
1063 * code, platform, script, and/or language, call the function
1064 * ATSUFindFontFromName. To obtain the font name string, name code,
1065 * platform, script, and language for the font that matches an ATSUI
1066 * font ID and name table index, call the function
1067 * ATSUGetIndFontName. Although they will each accept NULL on input
1068 * individually, you must pass a vaild pointer to at least one of
1069 * the three parameters oName, oActualNameLength, or oFontNameIndex,
1070 * or ATSUFindFontName will return paramErr.
1071 *
1072 * Parameters:
1073 *
1074 * iFontID:
1075 * The font for which to obtain a name string. Note that because
1076 * Apple Type Services assigns ATSUFontID values systemwide at
1077 * runtime, font IDs can change across system restarts.
1078 *
1079 * iFontNameCode:
1080 * A constant specifying the FontNameCode value of the font for
1081 * which to obtain a name string. See the SFNTTypes.h header file
1082 * for a definition of the FontNameCode type and a list of
1083 * possible values.
1084 *
1085 * iFontNamePlatform:
1086 * A constant specifying the encoding of the font. See SFNTTypes.h
1087 * for possible values to pass for this parameter. If you pass the
1088 * kFontNoPlatformCode constant, ATSUFindFontName produces the
1089 * first font in the name table matching the other specified
1090 * parameters.
1091 *
1092 * iFontNameScript:
1093 * A constant specifying the script of the font. See SFNTTypes.h
1094 * for possible values to pass for this parameter. If you pass the
1095 * kFontNoScriptCode constant, ATSUFindFontName produces the first
1096 * font in the name table matching the other specified parameters.
1097 *
1098 * iFontNameLanguage:
1099 * A constant specifying the language of the font you are
1100 * searching for. See SFNTLayoutTypes.h for possible values to
1101 * pass for this parameter.
1102 *
1103 * iMaximumNameLength:
1104 * The maximum size of string you want ATSUFindFontName to return.
1105 * Typically, this value is equal to the size of the buffer you
1106 * have allocated for the oName parameter. To determine this
1107 * length, see the Discussion.
1108 *
1109 * oName:
1110 * On return, the name string of the first font in the font name
1111 * table matching your specified parameters. If the buffer you
1112 * allocate is not large enough, ATSUFindFontName produces a
1113 * partial string. If you are unsure how much space to allocate
1114 * for this parameter, see the Discussion.
1115 *
1116 * oActualNameLength:
1117 * On return, specifies the actual length of the complete name
1118 * string. This may be greater than the value passed in the
1119 * iMaximumNameLength parameter. You should check this value to
1120 * ensure that you have allocated sufficient memory and therefore
1121 * obtained the complete name string for the font.
1122 *
1123 * oFontNameIndex:
1124 * On return, the value provides a 0-based index to the font name
1125 * in the font name table.
1126 *
1127 * Result:
1128 * On success, noErr is returned. See MacErrors.h for possible error
1129 * codes.
1130 *
1131 * Availability:
1132 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1133 * CarbonLib: in CarbonLib 1.0 and later
1134 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1135 }
ATSUFindFontNamenull1136 function ATSUFindFontName( iFontID: ATSUFontID; iFontNameCode: FontNameCode; iFontNamePlatform: FontPlatformCode; iFontNameScript: FontScriptCode; iFontNameLanguage: FontLanguageCode; iMaximumNameLength: ByteCount; oName: Ptr { can be NULL }; oActualNameLength: ByteCountPtr { can be NULL }; oFontNameIndex: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUFindFontName';
1137 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1138
1139
1140 {
1141 * ATSUFindFontFromName() *** DEPRECATED ***
1142 *
1143 * Deprecated:
1144 * Use CTFontCreateWithName instead.
1145 *
1146 * Summary:
1147 * Obtains an ATSUI font ID for the first font in a name table that
1148 * matches the specified name string, name code, platform, script,
1149 * and/or language.
1150 *
1151 * Discussion:
1152 * Because ATSUI cannot guarantee the uniqueness of names among
1153 * installed fonts, ATSUFindFontFromName does not necessarily find
1154 * the only font that matches these parameters. As a result, you may
1155 * want to create a more sophisticated name-matching algorithm or
1156 * guarantee the uniqueness of names among installed fonts.
1157 *
1158 * Parameters:
1159 *
1160 * iName:
1161 * A pointer to a buffer containing the name string of the font
1162 * for which to obtain an ATSUI font ID.
1163 *
1164 * iNameLength:
1165 * The length, in bytes, of the name string provided in the iName
1166 * parameter.
1167 *
1168 * iFontNameCode:
1169 * A constant specifying the type of name to search for (i.e.,
1170 * full name, postcript name). See SFNTTypes.h for a list possible
1171 * values to pass for this parameter.
1172 *
1173 * iFontNamePlatform:
1174 * A constant specifying the encoding of the font you are
1175 * searching for. See SFNTTypes.h for possible values to pass for
1176 * this parameter. Pass kFontNoPlatformCode if you do not want to
1177 * limit your search to a particular encoding.
1178 *
1179 * iFontNameScript:
1180 * A constant specifying the script of the font you are searching
1181 * for. See SFNTTypes.h for possible values to pass for this
1182 * parameter. Pass kFontNoScriptCode if you do not want to limit
1183 * your search to a particular script.
1184 *
1185 * iFontNameLanguage:
1186 * A constant specifying the language of the font you are
1187 * searching for. See SFNTTypes.h for possible values to pass for
1188 * this parameter. Pass kFontNoLanguageCode if you do not want to
1189 * limit your search to a particular language.
1190 *
1191 * oFontID:
1192 * On return, the value provides a unique identifier for the
1193 * specified font. If no installed font matches the specified
1194 * parameters, kATSUInvalidFontID is returned for this parameter.
1195 *
1196 * Result:
1197 * On success, noErr is returned. If the font cannot be found,
1198 * kATSUInvalidFontErr is returned. See MacErrors.h for other
1199 * possible error codes.
1200 *
1201 * Availability:
1202 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1203 * CarbonLib: in CarbonLib 1.0 and later
1204 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1205 }
ATSUFindFontFromNamenull1206 function ATSUFindFontFromName( iName: {const} UnivPtr; iNameLength: ByteCount; iFontNameCode: FontNameCode; iFontNamePlatform: FontPlatformCode; iFontNameScript: FontScriptCode; iFontNameLanguage: FontLanguageCode; var oFontID: ATSUFontID ): OSStatus; external name '_ATSUFindFontFromName';
1207 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1208
1209
1210 { ---------------------------------------------------------------------------- }
1211 { Font features }
1212 { ---------------------------------------------------------------------------- }
1213 {
1214 * ATSUCountFontFeatureTypes() *** DEPRECATED ***
1215 *
1216 * Deprecated:
1217 * Use CTFontCopyFeatures, CTFontCopyFeatureSettings instead.
1218 *
1219 * Summary:
1220 * Obtains the number of available feature types in a font.
1221 *
1222 * Discussion:
1223 * This function function obtains the total number of feature types
1224 * defined for a font. You can use the count produced by
1225 * ATSUCountFontFeatureTypes to determine how much memory to
1226 * allocate for the oTypes array in the function
1227 * ATSUGetFontFeatureTypes.
1228 *
1229 * Parameters:
1230 *
1231 * iFontID:
1232 * The font for which to obtain a count of feature types.
1233 *
1234 * oTypeCount:
1235 * On return, the actual number of feature types defined for the
1236 * font.
1237 *
1238 * Result:
1239 * On success, noErr is returned. See MacErrors.h for possible error
1240 * codes.
1241 *
1242 * Availability:
1243 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1244 * CarbonLib: in CarbonLib 1.0 and later
1245 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1246 }
ATSUCountFontFeatureTypesnull1247 function ATSUCountFontFeatureTypes( iFontID: ATSUFontID; var oTypeCount: ItemCount ): OSStatus; external name '_ATSUCountFontFeatureTypes';
1248 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1249
1250
1251 {
1252 * ATSUCountFontFeatureSelectors() *** DEPRECATED ***
1253 *
1254 * Deprecated:
1255 * Use CTFontCopyFeatures, CTFontCopyFeatureSettings instead.
1256 *
1257 * Summary:
1258 * Obtains the number of available feature selectors for a given
1259 * feature type in a font.
1260 *
1261 * Discussion:
1262 * This function obtains the total number of feature selectors
1263 * defined for a given feature type in the font. You can use the
1264 * count produced by ATSUCountFontFeatureSelectors to determine how
1265 * much memory to allocate for the oSelectors array in the function
1266 * ATSUGetFontFeatureSelectors.
1267 *
1268 * Parameters:
1269 *
1270 * iFontID:
1271 * The font for which to obtain feature selector information.
1272 *
1273 * iType:
1274 * A value specifying one of the font's supported feature types.
1275 * To obtain the available feature types for a font, call the
1276 * function ATSUGetFontFeatureTypes.
1277 *
1278 * oSelectorCount:
1279 * On return, specifies the actual number of feature selectors
1280 * defined for the feature type by the font.
1281 *
1282 * Result:
1283 * On success, noErr is returned. See MacErrors.h for possible error
1284 * codes.
1285 *
1286 * Availability:
1287 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1288 * CarbonLib: in CarbonLib 1.0 and later
1289 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1290 }
ATSUCountFontFeatureSelectorsnull1291 function ATSUCountFontFeatureSelectors( iFontID: ATSUFontID; iType: ATSUFontFeatureType; var oSelectorCount: ItemCount ): OSStatus; external name '_ATSUCountFontFeatureSelectors';
1292 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1293
1294
1295 {
1296 * ATSUGetFontFeatureTypes() *** DEPRECATED ***
1297 *
1298 * Deprecated:
1299 * Use CTFontCopyFeatures, CTFontCopyFeatureSettings instead.
1300 *
1301 * Summary:
1302 * Obtains the available feature types of a font.
1303 *
1304 * Discussion:
1305 * A given font may not support all possible feature types and
1306 * selectors. If you select features that are not available in a
1307 * font, you won't see a change in the glyph's appearance. To
1308 * determine the available features of a font, you can call the
1309 * functions ATSUGetFontFeatureTypes and
1310 * ATSUGetFontFeatureSelectors. The ATSUGetFontFeatureTypes function
1311 * reads the font data table for the specified font and obtains its
1312 * supported feature types. You can then use this information both
1313 * to present the user a list of font features from which to select
1314 * and to call such functions as ATSUSetFontFeatures with more
1315 * accuracy.
1316 *
1317 * Parameters:
1318 *
1319 * iFontID:
1320 * The font for which to obtain information about feature types.
1321 *
1322 * iMaximumTypes:
1323 * The maximum number of feature types to obtain for the font.
1324 * Typically, this is equivalent to the number of elements in the
1325 * oTypes array.
1326 *
1327 * oTypes:
1328 * A pointer to memory you have allocated for an array of
1329 * ATSUFontFeatureType values. You can call the function
1330 * ATSUCountFontFeatureTypes to obtain the number of available
1331 * feature types for a given font and thus determine the amount of
1332 * memory to allocate. On return, the array contains constants
1333 * identifying each type of feature that is defined for the font.
1334 * The constants that represent font feature types are defined in
1335 * the header file SFNTLayoutTypes.h and are described in the
1336 * official ATSUI documentation, available on the Apple developer
1337 * website.
1338 *
1339 * oActualTypeCount:
1340 * On return, the actual number of feature types defined in the
1341 * font. This may be greater than the value you specify in the
1342 * iMaximumTypes parameter.
1343 *
1344 * Result:
1345 * On success, noErr is returned. See MacErrors.h for possible error
1346 * codes.
1347 *
1348 * Availability:
1349 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1350 * CarbonLib: in CarbonLib 1.0 and later
1351 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1352 }
ATSUGetFontFeatureTypesnull1353 function ATSUGetFontFeatureTypes( iFontID: ATSUFontID; iMaximumTypes: ItemCount; oTypes: {variable-size-array} ATSUFontFeatureTypePtr { can be NULL }; oActualTypeCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetFontFeatureTypes';
1354 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1355
1356
1357 {
1358 * ATSUGetFontFeatureSelectors() *** DEPRECATED ***
1359 *
1360 * Deprecated:
1361 * Use CTFontCopyFeatures, CTFontCopyFeatureSettings instead.
1362 *
1363 * Summary:
1364 * Obtains the available feature selectors for a given feature type
1365 * in a font.
1366 *
1367 * Discussion:
1368 * A given font may not support all possible feature types and
1369 * selectors. If you select features that are not available in a
1370 * font, you won't see a change in the glyph's appearance. To
1371 * determine the available features of a font, you can call the
1372 * functions ATSUGetFontFeatureTypes and
1373 * ATSUGetFontFeatureSelectors. The ATSUGetFontFeatureSelectors
1374 * function reads the font data table for the specified font and
1375 * obtains its supported feature selectors for the given feature
1376 * types. You can then use this information both to present the user
1377 * a list of font features from which to select and to call such
1378 * functions as ATSUSetFontFeatures with more accuracy.
1379 *
1380 * Parameters:
1381 *
1382 * iFontID:
1383 * The font for which to obtain feature selectors.
1384 *
1385 * iType:
1386 * An ATSUFontFeatureType value specifying one of the font's
1387 * supported feature types. To obtain the available feature types
1388 * for a font, call the function ATSUGetFontFeatureTypes.
1389 *
1390 * iMaximumSelectors:
1391 * An ItemCount value specifying the maximum number of feature
1392 * selectors to obtain for the font's specified feature type.
1393 * Typically, this is equivalent to the number of elements in the
1394 * oSelectors array.
1395 *
1396 * oSelectors:
1397 * A pointer to memory you have allocated for an array of
1398 * ATSUFontFeatureSelector values. You can call the function
1399 * ATSUCountFontFeatureSelectors to obtain the number of available
1400 * feature selectors for a given font feature type and thus
1401 * determine the amount of memory to allocate. On return, the
1402 * array contains constants identifying each available feature
1403 * selector for the given feature type. The constants that
1404 * represent font feature selectors are defined in the header file
1405 * SFNTLayoutTypes.h and are described in the official ATSUI
1406 * documentation, available on the Apple developer website.
1407 *
1408 * oSelectorIsOnByDefault:
1409 * A pointer to memory you have allocated for an array of Boolean
1410 * values. The number of elements in this array should correspond
1411 * to the number of elements in the oSelectors array. On return,
1412 * the array contains Boolean values indicating whether the
1413 * corresponding feature selector in the oSelectors array is on or
1414 * off. If true, the feature selector is on by default; if false,
1415 * off.
1416 *
1417 * oActualSelectorCount:
1418 * On return, the value specifies the actual number of feature
1419 * selectors defined for the given feature type. This value may be
1420 * greater than the value you specify in the iMaximumSelectors
1421 * parameter.
1422 *
1423 * oIsMutuallyExclusive:
1424 * On return, the value indicates whether the feature selectors
1425 * for the given feature type are exclusive or nonexclusive. If a
1426 * feature type is exclusive you can choose only one of its
1427 * available feature selectors at a time, such as whether to
1428 * display numbers as proportional or fixed-width. If a feature
1429 * type is nonexclusive, you can enable any number of feature
1430 * selectors at once. If true , the feature type is exclusive and
1431 * only one selector can be used at a time.
1432 *
1433 * Result:
1434 * On success, noErr is returned. See MacErrors.h for possible error
1435 * codes.
1436 *
1437 * Availability:
1438 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1439 * CarbonLib: in CarbonLib 1.0 and later
1440 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1441 }
ATSUGetFontFeatureSelectorsnull1442 function ATSUGetFontFeatureSelectors( iFontID: ATSUFontID; iType: ATSUFontFeatureType; iMaximumSelectors: ItemCount; oSelectors: {variable-size-array} ATSUFontFeatureSelectorPtr { can be NULL }; oSelectorIsOnByDefault: {variable-size-array} BooleanPtr { can be NULL }; oActualSelectorCount: ItemCountPtr { can be NULL }; oIsMutuallyExclusive: BooleanPtr { can be NULL } ): OSStatus; external name '_ATSUGetFontFeatureSelectors';
1443 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1444
1445
1446 {
1447 * ATSUGetFontFeatureNameCode() *** DEPRECATED ***
1448 *
1449 * Deprecated:
1450 * Use CTFontCopyFeatures, CTFontCopyFeatureSettings instead.
1451 *
1452 * Summary:
1453 * btains the name code for a font's feature type or selector that
1454 * matches an ASTUI font ID, feature type, and feature selector.
1455 *
1456 * Discussion:
1457 * This function obtains the name code for a font's feature type or
1458 * selector that matches an ASTUI font ID, feature type and feature
1459 * selector values. By default, ATSUGetFontFeatureNameCode function
1460 * obtains the name code of a feature selector. To determine the
1461 * name code of a feature type, pass the constant kATSUNoSelector in
1462 * the iSelector parameter. You can use the function
1463 * ATSUFindFontName to obtain the localized name string for the name
1464 * code produced by ATSUGetFontFeatureNameCode.
1465 *
1466 * Parameters:
1467 *
1468 * iFontID:
1469 * The font for which to obtain the name code for a feature type
1470 * or selector.
1471 *
1472 * iType:
1473 * A constant identifying a valid feature type. To obtain the
1474 * valid feature types for a font, call the function
1475 * ATSUGetFontFeatureTypes.
1476 *
1477 * iSelector:
1478 * A constant identifying a valid feature selector that
1479 * corresponds to the feature type passed in the iType parameter.
1480 * If you pass the constant kATSUNoSelector, the name code
1481 * produced by ATSUGetFontFeatureNameCode is that of the feature
1482 * type, not the feature selector. To obtain the valid feature
1483 * selectors for a font, call the function
1484 * ATSUGetFontFeatureSelectors.
1485 *
1486 * oNameCode:
1487 * On return, the value contains the name code for the font
1488 * feature selector or type. See the SFNTTypes.h header file for a
1489 * definition of the FontNameCode type and a list of possible
1490 * values.
1491 *
1492 * Result:
1493 * On success, noErr is returned. See MacErrors.h for possible error
1494 * codes.
1495 *
1496 * Availability:
1497 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1498 * CarbonLib: in CarbonLib 1.0 and later
1499 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1500 }
ATSUGetFontFeatureNameCodenull1501 function ATSUGetFontFeatureNameCode( iFontID: ATSUFontID; iType: ATSUFontFeatureType; iSelector: ATSUFontFeatureSelector; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontFeatureNameCode';
1502 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1503
1504
1505 { ---------------------------------------------------------------------------- }
1506 { Font tracking value & names }
1507 { ---------------------------------------------------------------------------- }
1508 {
1509 * ATSUCountFontTracking() *** DEPRECATED ***
1510 *
1511 * Deprecated:
1512 * Use CTFontCopyTable instead.
1513 *
1514 * Summary:
1515 * Obtains the number of entries in the font tracking table that
1516 * correspond to a given ATSUI font ID and glyph orientation.
1517 *
1518 * Discussion:
1519 * This function obtains the number of font tracking entries defined
1520 * in a font tracking table for a given ATSUI font ID and glyph
1521 * orientation. You can pass an index value based on this count to
1522 * the function ATSUGetIndFontTracking to obtain the name code and
1523 * tracking value of a font tracking.
1524 *
1525 * Parameters:
1526 *
1527 * iFontID:
1528 * The font for which to obtain tracking table information.
1529 *
1530 * iCharacterOrientation:
1531 * A constant identifying the glyph orientation of the font
1532 * tracking entries. See the definition of
1533 * ATSUVerticalCharacterType for a list of possible values.
1534 *
1535 * oTrackingCount:
1536 * On return, the number of entries in the font tracking table
1537 * corresponding to the given ATSUI font ID and glyph orientation.
1538 *
1539 * Result:
1540 * On success, noErr is returned. See MacErrors.h for possible error
1541 * codes.
1542 *
1543 * Availability:
1544 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1545 * CarbonLib: in CarbonLib 1.0 and later
1546 * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
1547 }
ATSUCountFontTrackingnull1548 function ATSUCountFontTracking( iFontID: ATSUFontID; iCharacterOrientation: ATSUVerticalCharacterType; var oTrackingCount: ItemCount ): OSStatus; external name '_ATSUCountFontTracking';
1549 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1550
1551
1552 {
1553 * ATSUGetIndFontTracking() *** DEPRECATED ***
1554 *
1555 * Deprecated:
1556 * Use CTFontCopyTable instead.
1557 *
1558 * Summary:
1559 * Obtains the name code and tracking value for the font tracking
1560 * that matches an ASTUI font ID, glyph orientation, and tracking
1561 * table index.
1562 *
1563 * Discussion:
1564 * You can call the ATSUGetIndFontTracking function to obtain the
1565 * name code and tracking value that matches the specified ATSUI
1566 * font ID, glyph orientation, and tracking table index value. This
1567 * information allows you to manipulate tracking settings for a
1568 * style using this font via the kATSUTrackingTag attribute. You can
1569 * use the function ATSUFindFontName to obtain the localized name
1570 * string for the name code produced by ATSUGetIndFontTracking.
1571 *
1572 * Parameters:
1573 *
1574 * iFontID:
1575 * The font for which to obtain tracking information.
1576 *
1577 * iCharacterOrientation:
1578 * A constant identifying the glyph orientation of the font
1579 * tracking entries. See the definition of
1580 * ATSUVerticalCharacterType for a list of possible values.
1581 *
1582 * iTrackIndex:
1583 * An index to the font tracking for which to obtain information.
1584 * Because this index must be 0-based, you should pass a value
1585 * between 0 and one less than the count produced by the function
1586 * ATSUCountFontTracking.
1587 *
1588 * oFontTrackingValue:
1589 * On return, the value contains the font tracking value.
1590 *
1591 * oNameCode:
1592 * On return, the value contains the name code for the font
1593 * tracking. See the SFNTTypes.h header file for a definition of
1594 * the FontNameCode type and a list of possible values.
1595 *
1596 * Result:
1597 * On success, noErr is returned. See MacErrors.h for possible error
1598 * codes.
1599 *
1600 * Availability:
1601 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1602 * CarbonLib: in CarbonLib 1.0 and later
1603 * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
1604 }
ATSUGetIndFontTrackingnull1605 function ATSUGetIndFontTracking( iFontID: ATSUFontID; iCharacterOrientation: ATSUVerticalCharacterType; iTrackIndex: ItemCount; var oFontTrackingValue: Fixed; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetIndFontTracking';
1606 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1607
1608
1609 { ---------------------------------------------------------------------------- }
1610 { Font variations }
1611 { ---------------------------------------------------------------------------- }
1612 {
1613 * ATSUCountFontVariations() *** DEPRECATED ***
1614 *
1615 * Deprecated:
1616 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1617 *
1618 * Summary:
1619 * Obtains the number of defined variation axes in a font.
1620 *
1621 * Discussion:
1622 * This function function obtains the total number of variation axes
1623 * defined for a font. You can use the count produced by
1624 * ATSUCountFontVariations to get information about a specific font
1625 * variation axis from the function ATSUGetIndFontVariation.
1626 *
1627 * Parameters:
1628 *
1629 * iFontID:
1630 * The font for which to obtain a count of variation axes.
1631 *
1632 * oVariationCount:
1633 * On return, a count of the number of variation axes defined for
1634 * the font.
1635 *
1636 * Result:
1637 * On success, noErr is returned. See MacErrors.h for possible error
1638 * codes.
1639 *
1640 * Availability:
1641 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1642 * CarbonLib: in CarbonLib 1.0 and later
1643 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1644 }
ATSUCountFontVariationsnull1645 function ATSUCountFontVariations( iFontID: ATSUFontID; var oVariationCount: ItemCount ): OSStatus; external name '_ATSUCountFontVariations';
1646 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1647
1648
1649 {
1650 * ATSUGetIndFontVariation() *** DEPRECATED ***
1651 *
1652 * Deprecated:
1653 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1654 *
1655 * Summary:
1656 * Obtains a variation axis and its value range for a font.
1657 *
1658 * Discussion:
1659 * By calling this function, you can obtain a variation axis and its
1660 * maximum, minimum, and default values for a font. If you supply
1661 * font variation axes and values to the function ATSUSetVariations,
1662 * you can change the appearance of a style object's font
1663 * accordingly. Note that while you may pass NULL for any of the
1664 * output parameters, at least one must be non-NULL or paramErr will
1665 * be returned.
1666 *
1667 * Parameters:
1668 *
1669 * iFontID:
1670 * A font for which to obtain variation information for.
1671 *
1672 * iVariationIndex:
1673 * A value specifying an index into the array of variation axes
1674 * for the font. This index identifies the font variation axis to
1675 * examine. Because this index is zero-based, you must pass a
1676 * value between 0 and one less than the value produced in the
1677 * oVariationCount parameter of the function
1678 * ATSUCountFontVariations.
1679 *
1680 * oATSUFontVariationAxis:
1681 * On return, a four-character code identifying the font variation
1682 * axis corresponding to the specified index.
1683 *
1684 * oMinimumValue:
1685 * On return, the variation axis minimum.
1686 *
1687 * oMaximumValue:
1688 * On return, the variation axis maximum.
1689 *
1690 * oDefaultValue:
1691 * On return, the variation axis default.
1692 *
1693 * Result:
1694 * On success, noErr is returned. See MacErrors.h for possible error
1695 * codes.
1696 *
1697 * Availability:
1698 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1699 * CarbonLib: in CarbonLib 1.0 and later
1700 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1701 }
ATSUGetIndFontVariationnull1702 function ATSUGetIndFontVariation( iFontID: ATSUFontID; iVariationIndex: ItemCount; oATSUFontVariationAxis: ATSUFontVariationAxisPtr { can be NULL }; oMinimumValue: ATSUFontVariationValuePtr { can be NULL }; oMaximumValue: ATSUFontVariationValuePtr { can be NULL }; oDefaultValue: ATSUFontVariationValuePtr { can be NULL } ): OSStatus; external name '_ATSUGetIndFontVariation';
1703 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1704
1705
1706 {
1707 * ATSUGetFontVariationNameCode() *** DEPRECATED ***
1708 *
1709 * Deprecated:
1710 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1711 *
1712 * Summary:
1713 * Obtains the name code for the font variation that matches an
1714 * ASTUI font ID and font variation axis.
1715 *
1716 * Discussion:
1717 * This function function obtains the name code for the font
1718 * variation that matches an ASTUI font ID and font variation axis
1719 * tag. You can use the function ATSUFindFontName to obtain the
1720 * localized name string for the name code produced by
1721 * ATSUGetFontVariationNameCode.
1722 *
1723 * Parameters:
1724 *
1725 * iFontID:
1726 * The font for which to obtain a font variation name code.
1727 *
1728 * iAxis:
1729 * An ATSUFontVariationAxis value representing a valid variation
1730 * axis tag. To obtain a valid variation axis tag for a font, you
1731 * can call the functions ATSUGetIndFontVariation or
1732 * ATSUGetFontInstance.
1733 *
1734 * oNameCode:
1735 * On return, the value contains the name code for the font
1736 * variation. See the SFNTTypes.h header file for a definition of
1737 * the FontNameCode type and a list of possible values.
1738 *
1739 * Result:
1740 * On success, noErr is returned. See MacErrors.h for possible error
1741 * codes.
1742 *
1743 * Availability:
1744 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1745 * CarbonLib: in CarbonLib 1.0 and later
1746 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1747 }
ATSUGetFontVariationNameCodenull1748 function ATSUGetFontVariationNameCode( iFontID: ATSUFontID; iAxis: ATSUFontVariationAxis; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontVariationNameCode';
1749 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1750
1751
1752 { ---------------------------------------------------------------------------- }
1753 { Font Instances }
1754 { ---------------------------------------------------------------------------- }
1755 {
1756 * ATSUCountFontInstances() *** DEPRECATED ***
1757 *
1758 * Deprecated:
1759 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1760 *
1761 * Summary:
1762 * Obtains the number of defined font instances in a font.
1763 *
1764 * Discussion:
1765 * This function obtains the total number of font instances defined
1766 * in a font. You can use an index value derived from this count to
1767 * get information about a specific font instance by calling the
1768 * function ATSUGetFontInstance.
1769 *
1770 * Parameters:
1771 *
1772 * iFontID:
1773 * The font for which to obtain a count of defined instances.
1774 *
1775 * oInstances:
1776 * On return, the value specifies the number of font instances
1777 * defined for the font.
1778 *
1779 * Result:
1780 * On success, noErr is returned. See MacErrors.h for possible error
1781 * codes.
1782 *
1783 * Availability:
1784 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1785 * CarbonLib: in CarbonLib 1.0 and later
1786 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1787 }
ATSUCountFontInstancesnull1788 function ATSUCountFontInstances( iFontID: ATSUFontID; var oInstances: ItemCount ): OSStatus; external name '_ATSUCountFontInstances';
1789 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1790
1791
1792 {
1793 * ATSUGetFontInstance() *** DEPRECATED ***
1794 *
1795 * Deprecated:
1796 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1797 *
1798 * Summary:
1799 * Obtains the font variation axis values for a font instance.
1800 *
1801 * Discussion:
1802 * with a minimum value of 0.0, a default of 0.5, and a maximum of
1803 * 1.0. Additionally, the variation axis 'wdth' is also defined for
1804 * the font, with a similar value range. The type designer can then
1805 * choose to declare a font instance for a set of specific values
1806 * within these axes, such as �Demibold� for a value of 0.8 for the
1807 * 'wght' axis and 0.5 for the 'wdth' axis. By calling the function
1808 * ATSUGetFontInstance , you can obtain the variation axis values
1809 * for a given index into an array of font instances. Typically you
1810 * use the function ATSUGetFontInstance by calling it twice, as
1811 * follows: (1) Pass the ID of the font to examine in the iFont
1812 * parameter, a valid pointer to an ItemCount value in the
1813 * oActualVariationCount parameter, NULL for the oAxes and oValues
1814 * parameters, and 0 for the other parameters. ATSUGetFontInstance
1815 * returns the size to use for the oAxes and oValues arrays in the
1816 * oActualVariationCount parameter. (2) Allocate enough space for
1817 * arrays of the returned size, then call the ATSUGetFontInstance
1818 * again, passing pointers to the arrays in the oAxes and oValues
1819 * parameters. On return, the arrays contain the font variation axes
1820 * and their corresponding values, respectively, for the font
1821 * instance.
1822 *
1823 * Parameters:
1824 *
1825 * iFontID:
1826 * The font for which to obtain instance information.
1827 *
1828 * iFontInstanceIndex:
1829 * An index into an array of instances for the font. This index
1830 * identifies the font instance to examine. Because this index is
1831 * zero-based, you must pass a value between 0 and one less than
1832 * the value produced in the oInstances parameter of the function
1833 * ATSUCountFontInstances.
1834 *
1835 * iMaximumVariations:
1836 * The maximum number of font variation axes to obtain for the
1837 * font instance. Typically, this is equivalent to the number of
1838 * ATSUFontVariationAxis and ATSUFontVariationValue values for
1839 * which you have allocated memory in the oAxes and oValues
1840 * parameters, respectively. To determine this value, see the
1841 * Discussion.
1842 *
1843 * oAxes:
1844 * On return, the array contains tags identifying the font
1845 * variation axes that constitute the font instance. If you are
1846 * uncertain of how much memory to allocate for this array, see
1847 * the Discussion.
1848 *
1849 * oValues:
1850 * On return, the array contains the defined values for the font
1851 * variation axes produced in the oAxes array. If you are
1852 * uncertain of how much memory to allocate for this array, see
1853 * the Discussion.
1854 *
1855 * oActualVariationCount:
1856 * On return, the actual number of font variation axes that
1857 * constitute the font instance. This may be greater than the
1858 * value you passed in the iMaximumVariations parameter.
1859 *
1860 * Result:
1861 * On success, noErr is returned. See MacErrors.h for possible error
1862 * codes.
1863 *
1864 * Availability:
1865 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1866 * CarbonLib: in CarbonLib 1.0 and later
1867 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1868 }
ATSUGetFontInstancenull1869 function ATSUGetFontInstance( iFontID: ATSUFontID; iFontInstanceIndex: ItemCount; iMaximumVariations: ItemCount; oAxes: {variable-size-array} ATSUFontVariationAxisPtr { can be NULL }; oValues: {variable-size-array} ATSUFontVariationValuePtr { can be NULL }; var oActualVariationCount: ItemCount ): OSStatus; external name '_ATSUGetFontInstance';
1870 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1871
1872
1873 {
1874 * ATSUGetFontInstanceNameCode() *** DEPRECATED ***
1875 *
1876 * Deprecated:
1877 * Use CTFontCopyVariationAxes, CTFontCopyVariation instead.
1878 *
1879 * Summary:
1880 * Obtains the name code for the font instance that matches an ASTUI
1881 * font ID and font instance index value.
1882 *
1883 * Discussion:
1884 * A font instance consists of a named set of values for each
1885 * variation axis in a font. The ATSUGetFontInstanceNameCode
1886 * function obtains the name code for the font instance that matches
1887 * an ASTUI font ID and font instance index value. You can use the
1888 * function ATSUFindFontName to obtain the localized name string for
1889 * the name code produced by ATSUGetFontInstanceNameCode. You can
1890 * obtain the font variation axis values for a font instance by
1891 * calling the function ATSUGetFontInstance.
1892 *
1893 * Parameters:
1894 *
1895 * iFontID:
1896 * The font for which to obtain a font instance name code.
1897 *
1898 * iInstanceIndex:
1899 * An index to the font instance for which to obtain a name code.
1900 * Because this index must be 0-based, you should pass a value
1901 * between 0 and one less than the count produced by the function
1902 * ATSUCountFontInstances.
1903 *
1904 * oNameCode:
1905 * On return, the name code for the font instance. See the
1906 * SFNTTypes.h header file for a definition of the FontNameCode
1907 * type and a list of possible values.
1908 *
1909 * Result:
1910 * On success, noErr is returned. See MacErrors.h for possible error
1911 * codes.
1912 *
1913 * Availability:
1914 * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
1915 * CarbonLib: in CarbonLib 1.0 and later
1916 * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
1917 }
ATSUGetFontInstanceNameCodenull1918 function ATSUGetFontInstanceNameCode( iFontID: ATSUFontID; iInstanceIndex: ItemCount; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontInstanceNameCode';
1919 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
1920
1921
1922 {$endc} {not TARGET_CPU_64}
1923
1924 {$endc} {TARGET_OS_MAC}
1925 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
1926
1927 end.
1928 {$endc} {not MACOSALLINCLUDE}
1929