Fonts.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:30k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Fonts.h
  3.  
  4.      Contains:   Public interface to the Font Manager.
  5.  
  6.      Version:    Technology: Mac OS 9
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __FONTS__
  18. #define __FONTS__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __FILES__
  23. #include "Files.h"
  24. #endif
  25. #ifndef __QUICKDRAW__
  26. #include "Quickdraw.h"
  27. #endif
  28. #ifndef __TEXTCOMMON__
  29. #include "TextCommon.h"
  30. #endif
  31. #ifndef __MACERRORS__
  32. #include "MacErrors.h"
  33. #endif
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50. enum {
  51.     systemFont                  = 0,
  52.     applFont                    = 1
  53. };
  54. /* kPlatformDefaultGuiFontID is used in QuickTime 3.0. */
  55. #if TARGET_OS_MAC
  56. enum {
  57.     kPlatformDefaultGuiFontID   = applFont
  58. };
  59. #else
  60. enum {
  61.     kPlatformDefaultGuiFontID   = -1
  62. };
  63. #endif  /* TARGET_OS_MAC */
  64. /*  The following font constants are deprecated; use GetFNum() to look up the font ID by name. */
  65. enum {
  66.     kFontIDNewYork              = 2,
  67.     kFontIDGeneva               = 3,
  68.     kFontIDMonaco               = 4,
  69.     kFontIDVenice               = 5,
  70.     kFontIDLondon               = 6,
  71.     kFontIDAthens               = 7,
  72.     kFontIDSanFrancisco         = 8,
  73.     kFontIDToronto              = 9,
  74.     kFontIDCairo                = 11,
  75.     kFontIDLosAngeles           = 12,
  76.     kFontIDTimes                = 20,
  77.     kFontIDHelvetica            = 21,
  78.     kFontIDCourier              = 22,
  79.     kFontIDSymbol               = 23,
  80.     kFontIDMobile               = 24
  81. };
  82. enum {
  83.     commandMark                 = 17,
  84.     checkMark                   = 18,
  85.     diamondMark                 = 19,
  86.     appleMark                   = 20
  87. };
  88. enum {
  89.     propFont                    = 36864L,
  90.     prpFntH                     = 36865L,
  91.     prpFntW                     = 36866L,
  92.     prpFntHW                    = 36867L,
  93.     fixedFont                   = 45056L,
  94.     fxdFntH                     = 45057L,
  95.     fxdFntW                     = 45058L,
  96.     fxdFntHW                    = 45059L,
  97.     fontWid                     = 44208L
  98. };
  99. struct FMInput {
  100.     short                           family;
  101.     short                           size;
  102.     Style                           face;
  103.     Boolean                         needBits;
  104.     short                           device;
  105.     Point                           numer;
  106.     Point                           denom;
  107. };
  108. typedef struct FMInput                  FMInput;
  109. struct FMOutput {
  110.     short                           errNum;
  111.     Handle                          fontHandle;
  112.     UInt8                           boldPixels;
  113.     UInt8                           italicPixels;
  114.     UInt8                           ulOffset;
  115.     UInt8                           ulShadow;
  116.     UInt8                           ulThick;
  117.     UInt8                           shadowPixels;
  118.     SInt8                           extra;
  119.     UInt8                           ascent;
  120.     UInt8                           descent;
  121.     UInt8                           widMax;
  122.     SInt8                           leading;
  123.     SInt8                           curStyle;
  124.     Point                           numer;
  125.     Point                           denom;
  126. };
  127. typedef struct FMOutput                 FMOutput;
  128. typedef FMOutput *                      FMOutputPtr;
  129. typedef FMOutputPtr                     FMOutPtr;
  130. struct FontRec {
  131.     short                           fontType;                   /*font type*/
  132.     short                           firstChar;                  /*ASCII code of first character*/
  133.     short                           lastChar;                   /*ASCII code of last character*/
  134.     short                           widMax;                     /*maximum character width*/
  135.     short                           kernMax;                    /*negative of maximum character kern*/
  136.     short                           nDescent;                   /*negative of descent*/
  137.     short                           fRectWidth;                 /*width of font rectangle*/
  138.     short                           fRectHeight;                /*height of font rectangle*/
  139.     unsigned short                  owTLoc;                     /*offset to offset/width table*/
  140.     short                           ascent;                     /*ascent*/
  141.     short                           descent;                    /*descent*/
  142.     short                           leading;                    /*leading*/
  143.     short                           rowWords;                   /*row width of bit image / 2 */
  144. };
  145. typedef struct FontRec                  FontRec;
  146. typedef FontRec *                       FontRecPtr;
  147. typedef FontRecPtr *                    FontRecHdl;
  148. struct FMetricRec {
  149.     Fixed                           ascent;                     /*base line to top*/
  150.     Fixed                           descent;                    /*base line to bottom*/
  151.     Fixed                           leading;                    /*leading between lines*/
  152.     Fixed                           widMax;                     /*maximum character width*/
  153.     Handle                          wTabHandle;                 /*handle to font width table*/
  154. };
  155. typedef struct FMetricRec               FMetricRec;
  156. typedef FMetricRec *                    FMetricRecPtr;
  157. typedef FMetricRecPtr *                 FMetricRecHandle;
  158. struct WidEntry {
  159.     short                           widStyle;                   /*style entry applies to*/
  160. };
  161. typedef struct WidEntry                 WidEntry;
  162. struct WidTable {
  163.     short                           numWidths;                  /*number of entries - 1*/
  164. };
  165. typedef struct WidTable                 WidTable;
  166. struct AsscEntry {
  167.     short                           fontSize;
  168.     short                           fontStyle;
  169.     short                           fontID;                     /*font resource ID*/
  170. };
  171. typedef struct AsscEntry                AsscEntry;
  172. struct FontAssoc {
  173.     short                           numAssoc;                   /*number of entries - 1*/
  174. };
  175. typedef struct FontAssoc                FontAssoc;
  176. struct StyleTable {
  177.     short                           fontClass;
  178.     long                            offset;
  179.     long                            reserved;
  180.     char                            indexes[48];
  181. };
  182. typedef struct StyleTable               StyleTable;
  183. struct NameTable {
  184.     short                           stringCount;
  185.     Str255                          baseFontName;
  186. };
  187. typedef struct NameTable                NameTable;
  188. struct KernPair {
  189.     char                            kernFirst;                  /*1st character of kerned pair*/
  190.     char                            kernSecond;                 /*2nd character of kerned pair*/
  191.     short                           kernWidth;                  /*kerning in 1pt fixed format*/
  192. };
  193. typedef struct KernPair                 KernPair;
  194. struct KernEntry {
  195.     short                           kernStyle;                  /*style the entry applies to*/
  196.     short                           kernLength;                 /*length of this entry*/
  197. };
  198. typedef struct KernEntry                KernEntry;
  199. struct KernTable {
  200.     short                           numKerns;                   /*number of kerning entries*/
  201. };
  202. typedef struct KernTable                KernTable;
  203. struct WidthTable {
  204.     Fixed                           tabData[256];               /*character widths*/
  205.     Handle                          tabFont;                    /*font record used to build table*/
  206.     long                            sExtra;                     /*space extra used for table*/
  207.     long                            style;                      /*extra due to style*/
  208.     short                           fID;                        /*font family ID*/
  209.     short                           fSize;                      /*font size request*/
  210.     short                           face;                       /*style (face) request*/
  211.     short                           device;                     /*device requested*/
  212.     Point                           inNumer;                    /*scale factors requested*/
  213.     Point                           inDenom;                    /*scale factors requested*/
  214.     short                           aFID;                       /*actual font family ID for table*/
  215.     Handle                          fHand;                      /*family record used to build up table*/
  216.     Boolean                         usedFam;                    /*used fixed point family widths*/
  217.     UInt8                           aFace;                      /*actual face produced*/
  218.     short                           vOutput;                    /*vertical scale output value*/
  219.     short                           hOutput;                    /*horizontal scale output value*/
  220.     short                           vFactor;                    /*vertical scale output value*/
  221.     short                           hFactor;                    /*horizontal scale output value*/
  222.     short                           aSize;                      /*actual size of actual font used*/
  223.     short                           tabSize;                    /*total size of table*/
  224. };
  225. typedef struct WidthTable               WidthTable;
  226. typedef WidthTable *                    WidthTablePtr;
  227. typedef WidthTablePtr *                 WidthTableHdl;
  228. struct FamRec {
  229.     short                           ffFlags;                    /*flags for family*/
  230.     short                           ffFamID;                    /*family ID number*/
  231.     short                           ffFirstChar;                /*ASCII code of 1st character*/
  232.     short                           ffLastChar;                 /*ASCII code of last character*/
  233.     short                           ffAscent;                   /*maximum ascent for 1pt font*/
  234.     short                           ffDescent;                  /*maximum descent for 1pt font*/
  235.     short                           ffLeading;                  /*maximum leading for 1pt font*/
  236.     short                           ffWidMax;                   /*maximum widMax for 1pt font*/
  237.     long                            ffWTabOff;                  /*offset to width table*/
  238.     long                            ffKernOff;                  /*offset to kerning table*/
  239.     long                            ffStylOff;                  /*offset to style mapping table*/
  240.     short                           ffProperty[9];              /*style property info*/
  241.     short                           ffIntl[2];                  /*for international use*/
  242.     short                           ffVersion;                  /*version number*/
  243. };
  244. typedef struct FamRec                   FamRec;
  245. typedef SInt16                          FontPointSize;
  246. #if CALL_NOT_IN_CARBON
  247. EXTERN_API( void )
  248. InitFonts                       (void)                                                      ONEWORDINLINE(0xA8FE);
  249. #endif  /* CALL_NOT_IN_CARBON */
  250. EXTERN_API( void )
  251. GetFontName                     (short                  familyID,
  252.                                  Str255                 name)                               ONEWORDINLINE(0xA8FF);
  253. EXTERN_API( void )
  254. GetFNum                         (ConstStr255Param       name,
  255.                                  short *                familyID)                           ONEWORDINLINE(0xA900);
  256. EXTERN_API( Boolean )
  257. RealFont                        (short                  fontNum,
  258.                                  short                  size)                               ONEWORDINLINE(0xA902);
  259. #if CALL_NOT_IN_CARBON
  260. EXTERN_API( void )
  261. SetFontLock                     (Boolean                lockFlag)                           ONEWORDINLINE(0xA903);
  262. #endif  /* CALL_NOT_IN_CARBON */
  263. EXTERN_API( FMOutPtr )
  264. FMSwapFont                      (const FMInput *        inRec)                              ONEWORDINLINE(0xA901);
  265. EXTERN_API( void )
  266. SetFScaleDisable                (Boolean                fscaleDisable)                      ONEWORDINLINE(0xA834);
  267. EXTERN_API( void )
  268. FontMetrics                     (FMetricRecPtr          theMetrics)                         ONEWORDINLINE(0xA835);
  269. EXTERN_API( void )
  270. SetFractEnable                  (Boolean                fractEnable)                        ONEWORDINLINE(0xA814);
  271. EXTERN_API( short )
  272. GetDefFontSize                  (void)                                                      FIVEWORDINLINE(0x3EB8, 0x0BA8, 0x6604, 0x3EBC, 0x000C);
  273. EXTERN_API( Boolean )
  274. IsOutline                       (Point                  numer,
  275.                                  Point                  denom)                              TWOWORDINLINE(0x7000, 0xA854);
  276. EXTERN_API( void )
  277. SetOutlinePreferred             (Boolean                outlinePreferred)                   TWOWORDINLINE(0x7001, 0xA854);
  278. EXTERN_API( Boolean )
  279. GetOutlinePreferred             (void)                                                      TWOWORDINLINE(0x7009, 0xA854);
  280. EXTERN_API( OSErr )
  281. OutlineMetrics                  (short                  byteCount,
  282.                                  const void *           textPtr,
  283.                                  Point                  numer,
  284.                                  Point                  denom,
  285.                                  short *                yMax,
  286.                                  short *                yMin,
  287.                                  FixedPtr               awArray,
  288.                                  FixedPtr               lsbArray,
  289.                                  RectPtr                boundsArray)                        TWOWORDINLINE(0x7008, 0xA854);
  290. EXTERN_API( void )
  291. SetPreserveGlyph                (Boolean                preserveGlyph)                      TWOWORDINLINE(0x700A, 0xA854);
  292. EXTERN_API( Boolean )
  293. GetPreserveGlyph                (void)                                                      TWOWORDINLINE(0x700B, 0xA854);
  294. #if CALL_NOT_IN_CARBON
  295. EXTERN_API( OSErr )
  296. FlushFonts                      (void)                                                      TWOWORDINLINE(0x700C, 0xA854);
  297. #endif  /* CALL_NOT_IN_CARBON */
  298. EXTERN_API_C( void )
  299. getfnum                         (const char *           theName,
  300.                                  short *                familyID);
  301. EXTERN_API_C( void )
  302. getfontname                     (short                  familyID,
  303.                                  char *                 theName);
  304. EXTERN_API( short )
  305. GetSysFont                      (void)                                                      TWOWORDINLINE(0x3EB8, 0x0BA6);
  306. EXTERN_API( short )
  307. GetAppFont                      (void)                                                      TWOWORDINLINE(0x3EB8, 0x0984);
  308. /*--------------------------------------------------------------------------------------*/
  309. /*  Extended font data functions (available only with Mac OS 8.5 or later)              */
  310. /*--------------------------------------------------------------------------------------*/
  311. EXTERN_API( OSStatus )
  312. SetAntiAliasedTextEnabled       (Boolean                iEnable,
  313.                                  SInt16                 iMinFontSize)                       TWOWORDINLINE(0x7011, 0xA854);
  314. EXTERN_API( Boolean )
  315. IsAntiAliasedTextEnabled        (SInt16 *               oMinFontSize)                       TWOWORDINLINE(0x7012, 0xA854);
  316. EXTERN_API( void )
  317. QDTextBounds                    (short                  byteCount,
  318.                                  const void *           textAddr,
  319.                                  Rect *                 bounds)                             TWOWORDINLINE(0x7013, 0xA854);
  320. EXTERN_API( OSErr )
  321. FetchFontInfo                   (SInt16                 fontID,
  322.                                  SInt16                 fontSize,
  323.                                  SInt16                 fontStyle,
  324.                                  FontInfo *             info)                               TWOWORDINLINE(0x7014, 0xA854);
  325. /*--------------------------------------------------------------------------------------*/
  326. /*  Font access and data management functions (available only with Mac OS 9.0 or later) */
  327. /*--------------------------------------------------------------------------------------*/
  328. typedef UInt32                          FMGeneration;
  329. /* The FMFontFamily reference represents a collection of fonts with the same design     */
  330. /* characteristics. It replaces the standard QuickDraw font identifer and may be used   */
  331. /* with all QuickDraw functions including GetFontName and TextFont. It cannot be used   */
  332. /* with the Resource Manager to access information from a FOND resource handle. A font  */
  333. /* reference does not imply a particular script system, nor is the character encoding   */
  334. /* of a font family determined by an arithmetic mapping of its value.                   */
  335. typedef SInt16                          FMFontFamily;
  336. typedef SInt16                          FMFontStyle;
  337. typedef SInt16                          FMFontSize;
  338. /* The font family is a collection of fonts, each of which is identified by an FMFont   */
  339. /* reference that maps to a single object registered with the font database. The font   */
  340. /* references associated with the font family consist of individual outline and         */
  341. /* bitmapped fonts that may be used with the font access routines of the Font Manager   */
  342. /* and ATS Unicode. */
  343. typedef UInt32                          FMFont;
  344. struct FMFontFamilyInstance {
  345.     FMFontFamily                    fontFamily;
  346.     FMFontStyle                     fontStyle;
  347. };
  348. typedef struct FMFontFamilyInstance     FMFontFamilyInstance;
  349. struct FMFontFamilyIterator {
  350.     UInt32                          reserved[16];
  351. };
  352. typedef struct FMFontFamilyIterator     FMFontFamilyIterator;
  353. struct FMFontIterator {
  354.     UInt32                          reserved[16];
  355. };
  356. typedef struct FMFontIterator           FMFontIterator;
  357. struct FMFontFamilyInstanceIterator {
  358.     UInt32                          reserved[16];
  359. };
  360. typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator;
  361. enum {
  362.     kInvalidGeneration          = 0L,
  363.     kInvalidFontFamily          = -1,
  364.     kInvalidFont                = 0L,
  365.     kFMCurrentFilterFormat      = 0L,
  366.     kFMDefaultOptions           = kNilOptions,
  367.     kFMUseGlobalScopeOption     = 0x00000001
  368. };
  369. typedef UInt32 FMFilterSelector;
  370. enum {
  371.     kFMInvalidFilterSelector    = 0L,
  372.     kFMFontTechnologyFilterSelector = 1L,
  373.     kFMFontContainerFilterSelector = 2L,
  374.     kFMGenerationFilterSelector = 3L,
  375.     kFMFontFamilyCallbackFilterSelector = 4L,
  376.     kFMFontCallbackFilterSelector = 5L
  377. };
  378. enum {
  379.     kFMTrueTypeFontTechnology   = FOUR_CHAR_CODE('true'),
  380.     kFMPostScriptFontTechnology = FOUR_CHAR_CODE('typ1')
  381. };
  382. typedef CALLBACK_API( OSStatus , FMFontFamilyCallbackFilterProcPtr )(FMFontFamily iFontFamily, void *iRefCon);
  383. typedef CALLBACK_API( OSStatus , FMFontCallbackFilterProcPtr )(FMFont iFont, void *iRefCon);
  384. typedef STACK_UPP_TYPE(FMFontFamilyCallbackFilterProcPtr)       FMFontFamilyCallbackFilterUPP;
  385. typedef STACK_UPP_TYPE(FMFontCallbackFilterProcPtr)             FMFontCallbackFilterUPP;
  386. #if OPAQUE_UPP_TYPES
  387. #if CALL_NOT_IN_CARBON
  388.     EXTERN_API(FMFontFamilyCallbackFilterUPP)
  389.     NewFMFontFamilyCallbackFilterUPP    (FMFontFamilyCallbackFilterProcPtr userRoutine);
  390.     EXTERN_API(FMFontCallbackFilterUPP)
  391.     NewFMFontCallbackFilterUPP     (FMFontCallbackFilterProcPtr userRoutine);
  392.     EXTERN_API(void)
  393.     DisposeFMFontFamilyCallbackFilterUPP    (FMFontFamilyCallbackFilterUPP userUPP);
  394.     EXTERN_API(void)
  395.     DisposeFMFontCallbackFilterUPP    (FMFontCallbackFilterUPP userUPP);
  396.     EXTERN_API(OSStatus)
  397.     InvokeFMFontFamilyCallbackFilterUPP    (FMFontFamily    iFontFamily,
  398.                                     void *                  iRefCon,
  399.                                     FMFontFamilyCallbackFilterUPP userUPP);
  400.     EXTERN_API(OSStatus)
  401.     InvokeFMFontCallbackFilterUPP    (FMFont                iFont,
  402.                                     void *                  iRefCon,
  403.                                     FMFontCallbackFilterUPP userUPP);
  404. #endif  /* CALL_NOT_IN_CARBON */
  405. #else
  406.     enum { uppFMFontFamilyCallbackFilterProcInfo = 0x000003B0 };    /* pascal 4_bytes Func(2_bytes, 4_bytes) */
  407.     enum { uppFMFontCallbackFilterProcInfo = 0x000003F0 };          /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  408.     #define NewFMFontFamilyCallbackFilterUPP(userRoutine)           (FMFontFamilyCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo, GetCurrentArchitecture())
  409.     #define NewFMFontCallbackFilterUPP(userRoutine)                 (FMFontCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo, GetCurrentArchitecture())
  410.     #define DisposeFMFontFamilyCallbackFilterUPP(userUPP)           DisposeRoutineDescriptor(userUPP)
  411.     #define DisposeFMFontCallbackFilterUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  412.     #define InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userUPP)  (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontFamilyCallbackFilterProcInfo, (iFontFamily), (iRefCon))
  413.     #define InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userUPP)  (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontCallbackFilterProcInfo, (iFont), (iRefCon))
  414. #endif
  415. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  416. #define NewFMFontFamilyCallbackFilterProc(userRoutine)          NewFMFontFamilyCallbackFilterUPP(userRoutine)
  417. #define NewFMFontCallbackFilterProc(userRoutine)                NewFMFontCallbackFilterUPP(userRoutine)
  418. #define CallFMFontFamilyCallbackFilterProc(userRoutine, iFontFamily, iRefCon) InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userRoutine)
  419. #define CallFMFontCallbackFilterProc(userRoutine, iFont, iRefCon) InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userRoutine)
  420. struct FMFilter {
  421.     UInt32                          format;
  422.     FMFilterSelector                selector;
  423.     union {
  424.         FourCharCode                    fontTechnologyFilter;
  425.         FSSpec                          fontContainerFilter;
  426.         FMGeneration                    generationFilter;
  427.         FMFontFamilyCallbackFilterUPP   fontFamilyCallbackFilter;
  428.         FMFontCallbackFilterUPP         fontCallbackFilter;
  429.     }                                 filter;
  430. };
  431. typedef struct FMFilter                 FMFilter;
  432. /* Enumeration */
  433. EXTERN_API_C( OSStatus )
  434. FMCreateFontFamilyIterator      (const FMFilter *       iFilter, /* can be NULL */
  435.                                  void *                 iRefCon,
  436.                                  OptionBits             iOptions,
  437.                                  FMFontFamilyIterator * ioIterator);
  438. EXTERN_API_C( OSStatus )
  439. FMDisposeFontFamilyIterator     (FMFontFamilyIterator * ioIterator);
  440. EXTERN_API_C( OSStatus )
  441. FMResetFontFamilyIterator       (const FMFilter *       iFilter, /* can be NULL */
  442.                                  void *                 iRefCon,
  443.                                  OptionBits             iOptions,
  444.                                  FMFontFamilyIterator * ioIterator);
  445. EXTERN_API_C( OSStatus )
  446. FMGetNextFontFamily             (FMFontFamilyIterator * ioIterator,
  447.                                  FMFontFamily *         oFontFamily);
  448. EXTERN_API_C( OSStatus )
  449. FMCreateFontIterator            (const FMFilter *       iFilter, /* can be NULL */
  450.                                  void *                 iRefCon,
  451.                                  OptionBits             iOptions,
  452.                                  FMFontIterator *       ioIterator);
  453. EXTERN_API_C( OSStatus )
  454. FMDisposeFontIterator           (FMFontIterator *       ioIterator);
  455. EXTERN_API_C( OSStatus )
  456. FMResetFontIterator             (const FMFilter *       iFilter, /* can be NULL */
  457.                                  void *                 iRefCon,
  458.                                  OptionBits             iOptions,
  459.                                  FMFontIterator *       ioIterator);
  460. EXTERN_API_C( OSStatus )
  461. FMGetNextFont                   (FMFontIterator *       ioIterator,
  462.                                  FMFont *               oFont);
  463. /* Font families */
  464. EXTERN_API_C( OSStatus )
  465. FMCreateFontFamilyInstanceIterator (FMFontFamily        iFontFamily,
  466.                                  FMFontFamilyInstanceIterator * ioIterator);
  467. EXTERN_API_C( OSStatus )
  468. FMDisposeFontFamilyInstanceIterator (FMFontFamilyInstanceIterator * ioIterator);
  469. EXTERN_API_C( OSStatus )
  470. FMResetFontFamilyInstanceIterator (FMFontFamily         iFontFamily,
  471.                                  FMFontFamilyInstanceIterator * ioIterator);
  472. EXTERN_API_C( OSStatus )
  473. FMGetNextFontFamilyInstance     (FMFontFamilyInstanceIterator * ioIterator,
  474.                                  FMFont *               oFont,
  475.                                  FMFontStyle *          oStyle, /* can be NULL */
  476.                                  FMFontSize *           oSize) /* can be NULL */;
  477. EXTERN_API_C( FMFontFamily )
  478. FMGetFontFamilyFromName         (ConstStr255Param       iName);
  479. EXTERN_API_C( OSStatus )
  480. FMGetFontFamilyName             (FMFontFamily           iFontFamily,
  481.                                  Str255                 oName);
  482. EXTERN_API_C( OSStatus )
  483. FMGetFontFamilyTextEncoding     (FMFontFamily           iFontFamily,
  484.                                  TextEncoding *         oTextEncoding);
  485. EXTERN_API_C( OSStatus )
  486. FMGetFontFamilyGeneration       (FMFontFamily           iFontFamily,
  487.                                  FMGeneration *         oGeneration);
  488. /* Fonts */
  489. EXTERN_API_C( OSStatus )
  490. FMGetFontFormat                 (FMFont                 iFont,
  491.                                  FourCharCode *         oFormat);
  492. EXTERN_API_C( OSStatus )
  493. FMGetFontTableDirectory         (FMFont                 iFont,
  494.                                  ByteCount              iLength,
  495.                                  void *                 iBuffer,
  496.                                  ByteCount *            oActualLength) /* can be NULL */;
  497. EXTERN_API_C( OSStatus )
  498. FMGetFontTable                  (FMFont                 iFont,
  499.                                  FourCharCode           iTag,
  500.                                  ByteOffset             iOffset,
  501.                                  ByteCount              iLength,
  502.                                  void *                 iBuffer,
  503.                                  ByteCount *            oActualLength) /* can be NULL */;
  504. EXTERN_API_C( OSStatus )
  505. FMGetFontGeneration             (FMFont                 iFont,
  506.                                  FMGeneration *         oGeneration);
  507. EXTERN_API_C( OSStatus )
  508. FMGetFontContainer              (FMFont                 iFont,
  509.                                  FSSpec *               oFontContainer);
  510. /* Conversion */
  511. EXTERN_API_C( OSStatus )
  512. FMGetFontFromFontFamilyInstance (FMFontFamily           iFontFamily,
  513.                                  FMFontStyle            iStyle,
  514.                                  FMFont *               oFont,
  515.                                  FMFontStyle *          oIntrinsicStyle) /* can be NULL */;
  516. EXTERN_API_C( OSStatus )
  517. FMGetFontFamilyInstanceFromFont (FMFont                 iFont,
  518.                                  FMFontFamily *         oFontFamily,
  519.                                  FMFontStyle *          oStyle);
  520. /* Activation */
  521. EXTERN_API_C( OSStatus )
  522. FMActivateFonts                 (const FSSpec *         iFontContainer,
  523.                                  const FMFilter *       iFilter, /* can be NULL */
  524.                                  void *                 iRefCon,
  525.                                  OptionBits             iOptions);
  526. EXTERN_API_C( OSStatus )
  527. FMDeactivateFonts               (const FSSpec *         iFontContainer,
  528.                                  const FMFilter *       iFilter, /* can be NULL */
  529.                                  void *                 iRefCon,
  530.                                  OptionBits             iOptions);
  531. EXTERN_API_C( FMGeneration )
  532. FMGetGeneration                 (void);
  533. typedef FMFontFamily                    FontFamilyID;
  534. /*--------------------------------------------------------------------------------------*/
  535. #if OLDROUTINENAMES
  536. enum {
  537.     newYork                     = kFontIDNewYork,
  538.     geneva                      = kFontIDGeneva,
  539.     monaco                      = kFontIDMonaco,
  540.     venice                      = kFontIDVenice,
  541.     london                      = kFontIDLondon,
  542.     athens                      = kFontIDAthens,
  543.     sanFran                     = kFontIDSanFrancisco,
  544.     toronto                     = kFontIDToronto,
  545.     cairo                       = kFontIDCairo,
  546.     losAngeles                  = kFontIDLosAngeles,
  547.     times                       = kFontIDTimes,
  548.     helvetica                   = kFontIDHelvetica,
  549.     courier                     = kFontIDCourier,
  550.     symbol                      = kFontIDSymbol,
  551.     mobile                      = kFontIDMobile
  552. };
  553. #endif  /* OLDROUTINENAMES */
  554. /*--------------------------------------------------------------------------------------*/
  555. #if PRAGMA_STRUCT_ALIGN
  556.     #pragma options align=reset
  557. #elif PRAGMA_STRUCT_PACKPUSH
  558.     #pragma pack(pop)
  559. #elif PRAGMA_STRUCT_PACK
  560.     #pragma pack()
  561. #endif
  562. #ifdef PRAGMA_IMPORT_OFF
  563. #pragma import off
  564. #elif PRAGMA_IMPORT
  565. #pragma import reset
  566. #endif
  567. #ifdef __cplusplus
  568. }
  569. #endif
  570. #endif /* __FONTS__ */