Mac OS 9
ATSFont.h
Go to the documentation of this file.
1 
20 #ifndef __ATSFONT__
21 #define __ATSFONT__
22 
23 #ifndef __MACTYPES__
24 #include <MacTypes.h>
25 #endif
26 
27 #ifndef __ATSTYPES__
28 #include <ATSTypes.h>
29 #endif
30 
31 #ifndef __CFSTRING__
32 #include <CFString.h>
33 #endif
34 
35 #ifndef __FILES__
36 #include <Files.h>
37 #endif
38 
39 #ifndef __TEXTCOMMON__
40 #include <TextCommon.h>
41 #endif
42 
43 #ifndef __SFNTTYPES__
44 #include <SFNTTypes.h>
45 #endif
46 
47 #if PRAGMA_ONCE
48 #pragma once
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55 
56 #if PRAGMA_IMPORT
57 #pragma import on
58 #endif
59 
60 #if PRAGMA_STRUCT_ALIGN
61 #pragma options align = mac68k
62 #elif PRAGMA_STRUCT_PACKPUSH
63 #pragma pack(push, 2)
64 #elif PRAGMA_STRUCT_PACK
65 #pragma pack(2)
66 #endif
67 
68 #if PRAGMA_ENUM_ALWAYSINT
69 #if defined(__fourbyteints__) && !__fourbyteints__
70 #define __ATSFONT__RESTORE_TWOBYTEINTS
71 #pragma fourbyteints on
72 #endif
73 #pragma enumsalwaysint on
74 #elif PRAGMA_ENUM_OPTIONS
75 #pragma option enum =int
76 #elif PRAGMA_ENUM_PACK
77 #if __option(pack_enums)
78 #define __ATSFONT__RESTORE_PACKED_ENUMS
79 #pragma options(!pack_enums)
80 #endif
81 #endif
82 
83  enum
84  {
85  kATSOptionFlagsDefault = kNilOptions,
86  kATSOptionFlagsComposeFontPostScriptName =
87  1 << 0, /* ATSFontGetPostScriptName */
88  kATSOptionFlagsUseDataForkAsResourceFork =
89  1 << 8, /* ATSFontActivateFromFileSpecification */
90  kATSOptionFlagsUseResourceFork = 2 << 8,
91  kATSOptionFlagsUseDataFork = 3 << 8
92  };
93 
94  enum
95  {
96  kATSIterationCompleted = -980L,
97  kATSInvalidFontFamilyAccess = -981L,
98  kATSInvalidFontAccess = -982L,
99  kATSIterationScopeModified = -983L,
100  kATSInvalidFontTableAccess = -984L,
101  kATSInvalidFontContainerAccess = -985L
102  };
103 
104  typedef UInt32 ATSFontContext;
105  enum
106  {
107  kATSFontContextUnspecified = 0,
108  kATSFontContextGlobal = 1
109  };
110 
111  typedef UInt32 ATSFontFormat;
112  enum
113  {
114  kATSFontFormatUnspecified = 0
115  };
116 
117  typedef CALLBACK_API_C(OSStatus,
118  ATSFontFamilyApplierFunction)(ATSFontFamilyRef iFamily,
119  void *iRefCon);
120  typedef CALLBACK_API_C(OSStatus, ATSFontApplierFunction)(ATSFontRef iFont,
121  void *iRefCon);
122  typedef struct ATSFontFamilyIterator_ *ATSFontFamilyIterator;
123  typedef struct ATSFontIterator_ *ATSFontIterator;
124  enum
125  {
126  kATSFontFilterCurrentVersion = 0
127  };
128 
129  enum ATSFontFilterSelector
130  {
131  kATSFontFilterSelectorUnspecified = 0,
132  kATSFontFilterSelectorGeneration = 3,
133  kATSFontFilterSelectorFontFamily = 7,
134  kATSFontFilterSelectorFontFamilyApplierFunction = 8,
135  kATSFontFilterSelectorFontApplierFunction = 9
136  };
137  typedef enum ATSFontFilterSelector ATSFontFilterSelector;
138 
140  {
141  UInt32 version;
142  ATSFontFilterSelector filterSelector;
143  union
144  {
145  ATSGeneration generationFilter;
146  ATSFontFamilyRef fontFamilyFilter;
147  ATSFontFamilyApplierFunction fontFamilyApplierFunctionFilter;
148  ATSFontApplierFunction fontApplierFunctionFilter;
149  } filter;
150  };
151  typedef struct ATSFontFilter ATSFontFilter;
152  /* -----------------------------------------------------------------------------------------
153  */
154  /* Font container */
155  /* -----------------------------------------------------------------------------------------
156  */
166  ATSGeneration
168 
178  OSStatus
180  ATSFontContext iContext,
181  ATSFontFormat iFormat, void *iReserved,
182  ATSOptionFlags iOptions,
183  ATSFontContainerRef *oContainer);
184 
194  OSStatus
195  ATSFontActivateFromMemory(LogicalAddress iData, ByteCount iLength,
196  ATSFontContext iContext, ATSFontFormat iFormat,
197  void *iReserved, ATSOptionFlags iOptions,
198  ATSFontContainerRef *oContainer);
199 
209  OSStatus
210  ATSFontDeactivate(ATSFontContainerRef iContainer, void *iRefCon,
211  ATSOptionFlags iOptions);
212 
213  /* -----------------------------------------------------------------------------------------
214  */
215  /* Font family */
216  /* -----------------------------------------------------------------------------------------
217  */
227  OSStatus
228  ATSFontFamilyApplyFunction(ATSFontFamilyApplierFunction iFunction,
229  void *iRefCon);
230 
240  OSStatus
241  ATSFontFamilyIteratorCreate(ATSFontContext iContext,
242  const ATSFontFilter *iFilter, /* can be NULL */
243  void *iRefCon, ATSOptionFlags iOptions,
244  ATSFontFamilyIterator *ioIterator);
245 
255  OSStatus
256  ATSFontFamilyIteratorRelease(ATSFontFamilyIterator *ioIterator);
257 
267  OSStatus
268  ATSFontFamilyIteratorReset(ATSFontContext iContext,
269  const ATSFontFilter *iFilter, /* can be NULL */
270  void *iRefCon, ATSOptionFlags iOptions,
271  ATSFontFamilyIterator *ioIterator);
272 
282  OSStatus
283  ATSFontFamilyIteratorNext(ATSFontFamilyIterator iIterator,
284  ATSFontFamilyRef *oFamily);
285 
295  ATSFontFamilyRef
296  ATSFontFamilyFindFromName(CFStringRef iName, ATSOptionFlags iOptions);
297 
307  ATSGeneration
308  ATSFontFamilyGetGeneration(ATSFontFamilyRef iFamily);
309 
319  OSStatus
320  ATSFontFamilyGetName(ATSFontFamilyRef iFamily, ATSOptionFlags iOptions,
321  CFStringRef *oName);
322 
332  TextEncoding
333  ATSFontFamilyGetEncoding(ATSFontFamilyRef iFamily);
334 
335  /* -----------------------------------------------------------------------------------------
336  */
337  /* Font */
338  /* -----------------------------------------------------------------------------------------
339  */
349  OSStatus
350  ATSFontApplyFunction(ATSFontApplierFunction iFunction, void *iRefCon);
351 
361  OSStatus
362  ATSFontIteratorCreate(ATSFontContext iContext,
363  const ATSFontFilter *iFilter, /* can be NULL */
364  void *iRefCon, ATSOptionFlags iOptions,
365  ATSFontIterator *ioIterator);
366 
376  OSStatus
377  ATSFontIteratorRelease(ATSFontIterator *ioIterator);
378 
388  OSStatus
389  ATSFontIteratorReset(ATSFontContext iContext,
390  const ATSFontFilter *iFilter, /* can be NULL */
391  void *iRefCon, ATSOptionFlags iOptions,
392  ATSFontIterator *ioIterator);
393 
403  OSStatus
404  ATSFontIteratorNext(ATSFontIterator iIterator, ATSFontRef *oFont);
405 
415  ATSFontRef
416  ATSFontFindFromName(CFStringRef iName, ATSOptionFlags iOptions);
417 
427  ATSFontRef
428  ATSFontFindFromPostScriptName(CFStringRef iName, ATSOptionFlags iOptions);
429 
439  OSStatus
440  ATSFontFindFromContainer(ATSFontContainerRef iContainer,
441  ATSOptionFlags iOptions, ItemCount iCount,
442  ATSFontRef ioArray[], ItemCount *oCount);
443 
453  ATSGeneration
454  ATSFontGetGeneration(ATSFontRef iFont);
455 
465  OSStatus
466  ATSFontGetName(ATSFontRef iFont, ATSOptionFlags iOptions, CFStringRef *oName);
467 
477  OSStatus
478  ATSFontGetPostScriptName(ATSFontRef iFont, ATSOptionFlags iOptions,
479  CFStringRef *oName);
480 
490  OSStatus
491  ATSFontGetTableDirectory(ATSFontRef iFont, ByteCount iBufferSize,
492  void *ioBuffer, ByteCount *oSize); /* can be NULL */
493 
503  OSStatus
504  ATSFontGetTable(ATSFontRef iFont, FourCharCode iTag, ByteOffset iOffset,
505  ByteCount iBufferSize, void *ioBuffer,
506  ByteCount *oSize); /* can be NULL */
507 
517  OSStatus
518  ATSFontGetHorizontalMetrics(ATSFontRef iFont, ATSOptionFlags iOptions,
519  ATSFontMetrics *oMetrics);
520 
530  OSStatus
531  ATSFontGetVerticalMetrics(ATSFontRef iFont, ATSOptionFlags iOptions,
532  ATSFontMetrics *oMetrics);
533 
534  /* -----------------------------------------------------------------------------------------
535  */
536  /* Compatibiity */
537  /* -----------------------------------------------------------------------------------------
538  */
548  ATSFontFamilyRef
549  ATSFontFamilyFindFromQuickDrawName(ConstStr255Param iName);
550 
560  OSStatus
561  ATSFontFamilyGetQuickDrawName(ATSFontFamilyRef iFamily, Str255 oName);
562 
572  OSStatus
573  ATSFontGetFileSpecification(ATSFontRef iFont, FSSpec *oFile);
574 
584  OSStatus
585  ATSFontGetFontFamilyResource(ATSFontRef iFont, ByteCount iBufferSize,
586  void *ioBuffer,
587  ByteCount *oSize); /* can be NULL */
588 
589 #if PRAGMA_ENUM_ALWAYSINT
590 #pragma enumsalwaysint reset
591 #ifdef __ATSFONT__RESTORE_TWOBYTEINTS
592 #pragma fourbyteints off
593 #endif
594 #elif PRAGMA_ENUM_OPTIONS
595 #pragma option enum =reset
596 #elif defined(__ATSFONT__RESTORE_PACKED_ENUMS)
597 #pragma options(pack_enums)
598 #endif
599 
600 #if PRAGMA_STRUCT_ALIGN
601 #pragma options align = reset
602 #elif PRAGMA_STRUCT_PACKPUSH
603 #pragma pack(pop)
604 #elif PRAGMA_STRUCT_PACK
605 #pragma pack()
606 #endif
607 
608 #ifdef PRAGMA_IMPORT_OFF
609 #pragma import off
610 #elif PRAGMA_IMPORT
611 #pragma import reset
612 #endif
613 
614 #ifdef __cplusplus
615 }
616 #endif
617 
618 #endif /* __ATSFONT__ */
OSStatus ATSFontFamilyIteratorRelease(ATSFontFamilyIterator *ioIterator)
OSStatus ATSFontIteratorNext(ATSFontIterator iIterator, ATSFontRef *oFont)
OSStatus ATSFontGetFontFamilyResource(ATSFontRef iFont, ByteCount iBufferSize, void *ioBuffer, ByteCount *oSize)
ATSGeneration ATSFontGetGeneration(ATSFontRef iFont)
OSStatus ATSFontGetPostScriptName(ATSFontRef iFont, ATSOptionFlags iOptions, CFStringRef *oName)
OSStatus ATSFontGetTableDirectory(ATSFontRef iFont, ByteCount iBufferSize, void *ioBuffer, ByteCount *oSize)
OSStatus ATSFontGetFileSpecification(ATSFontRef iFont, FSSpec *oFile)
OSStatus ATSFontFamilyApplyFunction(ATSFontFamilyApplierFunction iFunction, void *iRefCon)
OSStatus ATSFontFamilyIteratorNext(ATSFontFamilyIterator iIterator, ATSFontFamilyRef *oFamily)
OSStatus ATSFontActivateFromFileSpecification(const FSSpec *iFile, ATSFontContext iContext, ATSFontFormat iFormat, void *iReserved, ATSOptionFlags iOptions, ATSFontContainerRef *oContainer)
OSStatus ATSFontFindFromContainer(ATSFontContainerRef iContainer, ATSOptionFlags iOptions, ItemCount iCount, ATSFontRef ioArray[], ItemCount *oCount)
ATSFontFamilyRef ATSFontFamilyFindFromName(CFStringRef iName, ATSOptionFlags iOptions)
OSStatus ATSFontFamilyGetQuickDrawName(ATSFontFamilyRef iFamily, Str255 oName)
OSStatus ATSFontGetHorizontalMetrics(ATSFontRef iFont, ATSOptionFlags iOptions, ATSFontMetrics *oMetrics)
OSStatus ATSFontDeactivate(ATSFontContainerRef iContainer, void *iRefCon, ATSOptionFlags iOptions)
ATSGeneration ATSFontFamilyGetGeneration(ATSFontFamilyRef iFamily)
ATSFontFamilyRef ATSFontFamilyFindFromQuickDrawName(ConstStr255Param iName)
OSStatus ATSFontFamilyIteratorReset(ATSFontContext iContext, const ATSFontFilter *iFilter, void *iRefCon, ATSOptionFlags iOptions, ATSFontFamilyIterator *ioIterator)
OSStatus ATSFontGetTable(ATSFontRef iFont, FourCharCode iTag, ByteOffset iOffset, ByteCount iBufferSize, void *ioBuffer, ByteCount *oSize)
OSStatus ATSFontIteratorCreate(ATSFontContext iContext, const ATSFontFilter *iFilter, void *iRefCon, ATSOptionFlags iOptions, ATSFontIterator *ioIterator)
OSStatus ATSFontApplyFunction(ATSFontApplierFunction iFunction, void *iRefCon)
OSStatus ATSFontIteratorReset(ATSFontContext iContext, const ATSFontFilter *iFilter, void *iRefCon, ATSOptionFlags iOptions, ATSFontIterator *ioIterator)
OSStatus ATSFontActivateFromMemory(LogicalAddress iData, ByteCount iLength, ATSFontContext iContext, ATSFontFormat iFormat, void *iReserved, ATSOptionFlags iOptions, ATSFontContainerRef *oContainer)
ATSFontRef ATSFontFindFromName(CFStringRef iName, ATSOptionFlags iOptions)
TextEncoding ATSFontFamilyGetEncoding(ATSFontFamilyRef iFamily)
OSStatus ATSFontFamilyGetName(ATSFontFamilyRef iFamily, ATSOptionFlags iOptions, CFStringRef *oName)
ATSFontRef ATSFontFindFromPostScriptName(CFStringRef iName, ATSOptionFlags iOptions)
OSStatus ATSFontFamilyIteratorCreate(ATSFontContext iContext, const ATSFontFilter *iFilter, void *iRefCon, ATSOptionFlags iOptions, ATSFontFamilyIterator *ioIterator)
OSStatus ATSFontIteratorRelease(ATSFontIterator *ioIterator)
OSStatus ATSFontGetName(ATSFontRef iFont, ATSOptionFlags iOptions, CFStringRef *oName)
OSStatus ATSFontGetVerticalMetrics(ATSFontRef iFont, ATSOptionFlags iOptions, ATSFontMetrics *oMetrics)
ATSGeneration ATSGetGeneration(void)
Public interfaces for Apple Type Services components.
File Manager (MFS, HFS, and HFS+) Interfaces.
Basic Macintosh data types.
Font file structures.
TextEncoding-related types and constants, and prototypes for related functions.
Definition: ATSFont.h:140
Definition: ATSTypes.h:344