Mac OS 9
ATSTypes.h
Go to the documentation of this file.
1 
19 #ifndef __ATSTYPES__
20 #define __ATSTYPES__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FILES__
27 #include <Files.h>
28 #endif
29 
30 #ifndef __MIXEDMODE__
31 #include <MixedMode.h>
32 #endif
33 
34 #if PRAGMA_ONCE
35 #pragma once
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 #if PRAGMA_IMPORT
44 #pragma import on
45 #endif
46 
47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = mac68k
49 #elif PRAGMA_STRUCT_PACKPUSH
50 #pragma pack(push, 2)
51 #elif PRAGMA_STRUCT_PACK
52 #pragma pack(2)
53 #endif
54 
55  typedef UInt32 FMGeneration;
56  /* The FMFontFamily reference represents a collection of fonts with the same
57  design characteristics. It replaces the standard QuickDraw font identifer and
58  may be used with all QuickDraw functions including GetFontName and TextFont.
59  It cannot be used with the Resource Manager to access information from a FOND
60  resource handle. A font reference does not imply a particular script system,
61  nor is the character encoding of a font family determined by an arithmetic
62  mapping of its value.
63  */
64  typedef SInt16 FMFontFamily;
65  typedef SInt16 FMFontStyle;
66  typedef SInt16 FMFontSize;
74  typedef UInt32 FMFont;
76  {
77  FMFontFamily fontFamily;
78  FMFontStyle fontStyle;
79  };
82  {
83  UInt32 reserved[16];
84  };
87  {
88  UInt32 reserved[16];
89  };
90  typedef struct FMFontIterator FMFontIterator;
92  {
93  UInt32 reserved[16];
94  };
96  enum
97  {
98  kInvalidGeneration = 0L,
99  kInvalidFontFamily = -1,
100  kInvalidFont = 0L
101  };
102 
103  enum
104  {
105  kFMCurrentFilterFormat = 0L
106  };
107 
108  /* kFMDefaultOptions & kFMUseGlobalScopeOption moved to Fonts.h */
109  typedef UInt32 FMFilterSelector;
110  enum
111  {
112  kFMFontTechnologyFilterSelector = 1L,
113  kFMFontContainerFilterSelector = 2L,
114  kFMGenerationFilterSelector = 3L,
115  kFMFontFamilyCallbackFilterSelector = 4L,
116  kFMFontCallbackFilterSelector = 5L,
117  kFMFontDirectoryFilterSelector = 6L
118  };
119 
120  enum
121  {
122  kFMTrueTypeFontTechnology = FOUR_CHAR_CODE('true'),
123  kFMPostScriptFontTechnology = FOUR_CHAR_CODE('typ1')
124  };
125 
126  typedef CALLBACK_API(OSStatus, FMFontFamilyCallbackFilterProcPtr)(
127  FMFontFamily iFontFamily, void *iRefCon);
128  typedef CALLBACK_API(OSStatus, FMFontCallbackFilterProcPtr)(FMFont iFont,
129  void *iRefCon);
130  typedef STACK_UPP_TYPE(FMFontFamilyCallbackFilterProcPtr)
131  FMFontFamilyCallbackFilterUPP;
132  typedef STACK_UPP_TYPE(FMFontCallbackFilterProcPtr) FMFontCallbackFilterUPP;
141  FMFontFamilyCallbackFilterUPP
142  NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine);
143 #if !OPAQUE_UPP_TYPES
144  enum
145  {
146  uppFMFontFamilyCallbackFilterProcInfo = 0x000003B0
147  }; /* pascal 4_bytes Func(2_bytes, 4_bytes) */
148 #ifdef __cplusplus
149  inline FMFontFamilyCallbackFilterUPP NewFMFontFamilyCallbackFilterUPP(
150  FMFontFamilyCallbackFilterProcPtr userRoutine)
151  {
152  return (FMFontFamilyCallbackFilterUPP)NewRoutineDescriptor(
153  (ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo,
154  GetCurrentArchitecture());
155  }
156 #else
157 #define NewFMFontFamilyCallbackFilterUPP(userRoutine) \
158  (FMFontFamilyCallbackFilterUPP) NewRoutineDescriptor( \
159  (ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo, \
160  GetCurrentArchitecture())
161 #endif
162 #endif
163 
172  FMFontCallbackFilterUPP
173  NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine);
174 #if !OPAQUE_UPP_TYPES
175  enum
176  {
177  uppFMFontCallbackFilterProcInfo = 0x000003F0
178  }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
179 #ifdef __cplusplus
180  inline FMFontCallbackFilterUPP
181  NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine)
182  {
183  return (FMFontCallbackFilterUPP)NewRoutineDescriptor(
184  (ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo,
185  GetCurrentArchitecture());
186  }
187 #else
188 #define NewFMFontCallbackFilterUPP(userRoutine) \
189  (FMFontCallbackFilterUPP) NewRoutineDescriptor( \
190  (ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo, \
191  GetCurrentArchitecture())
192 #endif
193 #endif
194 
203  void
204  DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP);
205 #if !OPAQUE_UPP_TYPES
206 #ifdef __cplusplus
207  inline void
208  DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP)
209  {
210  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
211  }
212 #else
213 #define DisposeFMFontFamilyCallbackFilterUPP(userUPP) \
214  DisposeRoutineDescriptor(userUPP)
215 #endif
216 #endif
217 
226  void
227  DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP);
228 #if !OPAQUE_UPP_TYPES
229 #ifdef __cplusplus
230  inline void DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP)
231  {
232  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
233  }
234 #else
235 #define DisposeFMFontCallbackFilterUPP(userUPP) \
236  DisposeRoutineDescriptor(userUPP)
237 #endif
238 #endif
239 
248  OSStatus
249  InvokeFMFontFamilyCallbackFilterUPP(FMFontFamily iFontFamily, void *iRefCon,
250  FMFontFamilyCallbackFilterUPP userUPP);
251 #if !OPAQUE_UPP_TYPES
252 #ifdef __cplusplus
253  inline OSStatus
254  InvokeFMFontFamilyCallbackFilterUPP(FMFontFamily iFontFamily, void *iRefCon,
255  FMFontFamilyCallbackFilterUPP userUPP)
256  {
257  return (OSStatus)CALL_TWO_PARAMETER_UPP(
258  userUPP, uppFMFontFamilyCallbackFilterProcInfo, iFontFamily, iRefCon);
259  }
260 #else
261 #define InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userUPP) \
262  (OSStatus) \
263  CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontFamilyCallbackFilterProcInfo, \
264  (iFontFamily), (iRefCon))
265 #endif
266 #endif
267 
276  OSStatus
277  InvokeFMFontCallbackFilterUPP(FMFont iFont, void *iRefCon,
278  FMFontCallbackFilterUPP userUPP);
279 #if !OPAQUE_UPP_TYPES
280 #ifdef __cplusplus
281  inline OSStatus InvokeFMFontCallbackFilterUPP(FMFont iFont, void *iRefCon,
282  FMFontCallbackFilterUPP userUPP)
283  {
284  return (OSStatus)CALL_TWO_PARAMETER_UPP(
285  userUPP, uppFMFontCallbackFilterProcInfo, iFont, iRefCon);
286  }
287 #else
288 #define InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userUPP) \
289  (OSStatus) CALL_TWO_PARAMETER_UPP( \
290  (userUPP), uppFMFontCallbackFilterProcInfo, (iFont), (iRefCon))
291 #endif
292 #endif
293 
294 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
295 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
296 #define NewFMFontFamilyCallbackFilterProc(userRoutine) \
297  NewFMFontFamilyCallbackFilterUPP(userRoutine)
298 #define NewFMFontCallbackFilterProc(userRoutine) \
299  NewFMFontCallbackFilterUPP(userRoutine)
300 #define CallFMFontFamilyCallbackFilterProc(userRoutine, iFontFamily, iRefCon) \
301  InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userRoutine)
302 #define CallFMFontCallbackFilterProc(userRoutine, iFont, iRefCon) \
303  InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userRoutine)
304 #endif /* CALL_NOT_IN_CARBON */
305 
307  {
308  SInt16 fontFolderDomain;
309  UInt32 reserved[2];
310  };
312  struct FMFilter
313  {
314  UInt32 format;
315  FMFilterSelector selector;
316  union
317  {
318  FourCharCode fontTechnologyFilter;
319  FSSpec fontContainerFilter;
320  FMGeneration generationFilter;
321  FMFontFamilyCallbackFilterUPP fontFamilyCallbackFilter;
322  FMFontCallbackFilterUPP fontCallbackFilter;
323  FMFontDirectoryFilter fontDirectoryFilter;
324  } filter;
325  };
326  typedef struct FMFilter FMFilter;
327 
328  typedef OptionBits ATSOptionFlags;
329  typedef UInt32 ATSGeneration;
330  typedef UInt32 ATSFontContainerRef;
331  typedef UInt32 ATSFontFamilyRef;
332  typedef UInt32 ATSFontRef;
333  typedef UInt16 ATSGlyphRef;
334  typedef Float32 ATSFontSize;
335  enum
336  {
337  kATSGenerationUnspecified = 0L,
338  kATSFontContainerRefUnspecified = 0L,
339  kATSFontFamilyRefUnspecified = 0L,
340  kATSFontRefUnspecified = 0L
341  };
342 
344  {
345  UInt32 version;
346  Float32 ascent; /* Maximum height above baseline reached by the glyphs in the
347  font */
348  /* or maximum distance to the right of the centerline reached by the glyphs in
349  * the font */
350  Float32 descent; /* Maximum depth below baseline reached by the glyphs in the
351  font */
352  /* or maximum distance to the left of the centerline reached by the glyphs in
353  * the font */
354  Float32 leading; /* Desired spacing between lines of text */
355  Float32 avgAdvanceWidth;
356  Float32 maxAdvanceWidth; /* Maximum advance width or height of the glyphs in
357  the font */
358  Float32 minLeftSideBearing; /* Minimum left or top side bearing */
359  Float32 minRightSideBearing; /* Minimum right or bottom side bearing */
360  Float32 stemWidth; /* Width of the dominant vertical stems of the glyphs in
361  the font */
362  Float32 stemHeight; /* Vertical width of the dominant horizontal stems of
363  glyphs in the font */
364  Float32 capHeight; /* Height of a capital letter from the baseline to the top
365  of the letter */
366  Float32 xHeight; /* Height of lowercase characters in a font, specifically the
367  letter x, excluding ascenders and descenders */
368  Float32
369  italicAngle; /* Angle in degrees counterclockwise from the vertical of the
370  dominant vertical strokes of the glyphs in the font */
371  Float32 underlinePosition; /* Distance from the baseline for positioning
372  underlining strokes */
373  Float32 underlineThickness; /* Stroke width for underlining */
374  };
375  typedef struct ATSFontMetrics ATSFontMetrics;
376  enum
377  {
378  kATSItalicQDSkew = (1 << 16) / 4, /* fixed value of 0.25 */
379  kATSBoldQDStretch = (1 << 16) * 3 / 2, /* fixed value of 1.50 */
380  kATSRadiansFactor = 1144 /* fixed value of approx. pi/180 (0.0174560546875) */
381  };
382 
383  /* Glyph outline path constants used in ATSFontGetNativeCurveType. */
384  typedef UInt16 ATSCurveType;
385  enum
386  {
387  kATSCubicCurveType = 0x0001,
388  kATSQuadCurveType = 0x0002,
389  kATSOtherCurveType = 0x0003
390  };
391 
393  {
394  UInt32 vectors;
395  UInt32 controlBits[1];
396  Float32Point vector[1];
397  };
398  typedef struct ATSUCurvePath ATSUCurvePath;
400  {
401  UInt32 contours;
402  ATSUCurvePath contour[1];
403  };
404  typedef struct ATSUCurvePaths ATSUCurvePaths;
405  /* Glyph ideal metrics */
407  {
408  Float32Point advance;
409  Float32Point sideBearing;
410  Float32Point otherSideBearing;
411  };
413  /* Glyph screen metrics */
415  {
416  Float32Point deviceAdvance;
417  Float32Point topLeft;
418  UInt32 height;
419  UInt32 width;
420  Float32Point sideBearing;
421  Float32Point otherSideBearing;
422  };
424 
425  typedef ATSGlyphRef GlyphID;
426 
427 #if PRAGMA_STRUCT_ALIGN
428 #pragma options align = reset
429 #elif PRAGMA_STRUCT_PACKPUSH
430 #pragma pack(pop)
431 #elif PRAGMA_STRUCT_PACK
432 #pragma pack()
433 #endif
434 
435 #ifdef PRAGMA_IMPORT_OFF
436 #pragma import off
437 #elif PRAGMA_IMPORT
438 #pragma import reset
439 #endif
440 
441 #ifdef __cplusplus
442 }
443 #endif
444 
445 #endif /* __ATSTYPES__ */
void DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP)
UInt32 FMFont
Definition: ATSTypes.h:74
FMFontCallbackFilterUPP NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine)
FMFontFamilyCallbackFilterUPP NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine)
OSStatus InvokeFMFontCallbackFilterUPP(FMFont iFont, void *iRefCon, FMFontCallbackFilterUPP userUPP)
void DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP)
OSStatus InvokeFMFontFamilyCallbackFilterUPP(FMFontFamily iFontFamily, void *iRefCon, FMFontFamilyCallbackFilterUPP userUPP)
File Manager (MFS, HFS, and HFS+) Interfaces.
Basic Macintosh data types.
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Definition: ATSTypes.h:344
Definition: ATSTypes.h:407
Definition: ATSTypes.h:415
Definition: ATSTypes.h:393
Definition: ATSTypes.h:400
Definition: ATSTypes.h:313
Definition: ATSTypes.h:307
Definition: ATSTypes.h:92
Definition: ATSTypes.h:76
Definition: ATSTypes.h:82
Definition: ATSTypes.h:87
Definition: MacTypes.h:220