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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       FontSync.h
  3.  
  4.      Contains:   Public interface for FontSync
  5.  
  6.      Version:    Technology: Mac OS 9
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1999-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 __FONTSYNC__
  18. #define __FONTSYNC__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __FILES__
  23. #include "Files.h"
  24. #endif
  25. #ifndef __FONTS__
  26. #include "Fonts.h"
  27. #endif
  28. #ifndef __SFNTTYPES__
  29. #include "SFNTTypes.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=power
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50. /* Matching Options */
  51. typedef UInt32 FNSMatchOptions;
  52. enum {
  53.     kFNSMatchNames              = 0x00000001,                   /* font names must match */
  54.     kFNSMatchTechnology         = 0x00000002,                   /* scaler technology must match */
  55.     kFNSMatchGlyphs             = 0x00000004,                   /* glyph data must match */
  56.     kFNSMatchEncodings          = 0x00000008,                   /* cmaps must match */
  57.     kFNSMatchQDMetrics          = 0x00000010,                   /* QuickDraw Text metrics must match */
  58.     kFNSMatchATSUMetrics        = 0x00000020,                   /* ATSUI metrics (incl. vertical) must match */
  59.     kFNSMatchKerning            = 0x00000040,                   /* kerning data must match */
  60.     kFNSMatchWSLayout           = 0x00000080,                   /* WorldScript layout tables must match */
  61.     kFNSMatchAATLayout          = 0x00000100,                   /* AAT (incl. OpenType) layout tables must match */
  62.     kFNSMatchPrintEncoding      = 0x00000200,                   /* PostScript font and glyph names and re-encoding vector must match */
  63.     kFNSMissingDataNoMatch      = (unsigned long)0x80000000,    /* treat missing data as mismatch */
  64.     kFNSMatchAll                = (unsigned long)0xFFFFFFFF,    /* everything must match */
  65.     kFNSMatchDefaults           = 0                             /* use global default match options */
  66. };
  67. EXTERN_API_C( FNSMatchOptions )
  68. FNSMatchDefaultsGet             (void);
  69. /* Version control */
  70. typedef UInt32 FNSObjectVersion;
  71. enum {
  72.     kFNSVersionDontCare         = 0,
  73.     kFNSCurSysInfoVersion       = 1
  74. };
  75. /* No features defined yet.*/
  76. typedef UInt32                          FNSFeatureFlags;
  77. /*
  78.    The FontSync library version number is binary-coded decimal:
  79.    8 bits of major version, 4 minor version and 4 bits revision.
  80. */
  81. struct FNSSysInfo {
  82.     FNSObjectVersion                iSysInfoVersion;            /* fill this in before calling FNSSysInfoGet*/
  83.     FNSFeatureFlags                 oFeatures;
  84.     FNSObjectVersion                oCurRefVersion;
  85.     FNSObjectVersion                oMinRefVersion;
  86.     FNSObjectVersion                oCurProfileVersion;
  87.     FNSObjectVersion                oMinProfileVersion;
  88.     UInt16                          oFontSyncVersion;
  89. };
  90. typedef struct FNSSysInfo               FNSSysInfo;
  91. EXTERN_API_C( void )
  92. FNSSysInfoGet                   (FNSSysInfo *           ioInfo);
  93. /* FontSync References */
  94. typedef struct OpaqueFNSFontReference*  FNSFontReference;
  95. EXTERN_API_C( OSStatus )
  96. FNSReferenceGetVersion          (FNSFontReference       iReference,
  97.                                  FNSObjectVersion *     oVersion);
  98. EXTERN_API_C( OSStatus )
  99. FNSReferenceDispose             (FNSFontReference       iReference);
  100. EXTERN_API_C( OSStatus )
  101. FNSReferenceMatch               (FNSFontReference       iReference1,
  102.                                  FNSFontReference       iReference2,
  103.                                  FNSMatchOptions        iOptions,
  104.                                  FNSMatchOptions *      oFailedMatchOptions) /* can be NULL */;
  105. EXTERN_API_C( OSStatus )
  106. FNSReferenceFlattenedSize       (FNSFontReference       iReference,
  107.                                  ByteCount *            oFlattenedSize);
  108. EXTERN_API_C( OSStatus )
  109. FNSReferenceFlatten             (FNSFontReference       iReference,
  110.                                  void *                 oFlatReference, /* can be NULL */
  111.                                  ByteCount *            oFlattenedSize) /* can be NULL */;
  112. EXTERN_API_C( OSStatus )
  113. FNSReferenceUnflatten           (const void *           iFlatReference,
  114.                                  ByteCount              iFlattenedSize,
  115.                                  FNSFontReference *     oReference);
  116. /* FontSync Profiles */
  117. enum {
  118.     kFNSCreatorDefault          = 0,
  119.     kFNSProfileFileType         = FOUR_CHAR_CODE('fnsp')
  120. };
  121. typedef struct OpaqueFNSFontProfile*    FNSFontProfile;
  122. EXTERN_API_C( OSStatus )
  123. FNSProfileCreate                (const FSSpec *         iFile,
  124.                                  FourCharCode           iCreator,
  125.                                  ItemCount              iEstNumRefs,
  126.                                  FNSObjectVersion       iDesiredVersion,
  127.                                  FNSFontProfile *       oProfile);
  128. EXTERN_API_C( OSStatus )
  129. FNSProfileOpen                  (const FSSpec *         iFile,
  130.                                  Boolean                iOpenForWrite,
  131.                                  FNSFontProfile *       oProfile);
  132. EXTERN_API_C( OSStatus )
  133. FNSProfileGetVersion            (FNSFontProfile         iProfile,
  134.                                  FNSObjectVersion *     oVersion);
  135. EXTERN_API_C( OSStatus )
  136. FNSProfileCompact               (FNSFontProfile         iProfile);
  137. EXTERN_API_C( OSStatus )
  138. FNSProfileClose                 (FNSFontProfile         iProfile);
  139. EXTERN_API_C( OSStatus )
  140. FNSProfileAddReference          (FNSFontProfile         iProfile,
  141.                                  FNSFontReference       iReference);
  142. EXTERN_API_C( OSStatus )
  143. FNSProfileRemoveReference       (FNSFontProfile         iProfile,
  144.                                  FNSFontReference       iReference);
  145. EXTERN_API_C( OSStatus )
  146. FNSProfileRemoveIndReference    (FNSFontProfile         iProfile,
  147.                                  UInt32                 iIndex);
  148. EXTERN_API_C( OSStatus )
  149. FNSProfileClear                 (FNSFontProfile         iProfile);
  150. EXTERN_API_C( OSStatus )
  151. FNSProfileCountReferences       (FNSFontProfile         iProfile,
  152.                                  ItemCount *            oCount);
  153. EXTERN_API_C( OSStatus )
  154. FNSProfileGetIndReference       (FNSFontProfile         iProfile,
  155.                                  UInt32                 iWhichReference,
  156.                                  FNSFontReference *     oReference);
  157. EXTERN_API_C( OSStatus )
  158. FNSProfileMatchReference        (FNSFontProfile         iProfile,
  159.                                  FNSFontReference       iReference,
  160.                                  FNSMatchOptions        iMatchOptions,
  161.                                  ItemCount              iOutputSize,
  162.                                  UInt32                 oIndices[], /* can be NULL */
  163.                                  ItemCount *            oNumMatches) /* can be NULL */;
  164. /* Mapping to and from Font Objects */
  165. EXTERN_API_C( OSStatus )
  166. FNSReferenceCreate              (FMFont                 iFont,
  167.                                  FNSObjectVersion       iDesiredVersion,
  168.                                  FNSFontReference *     oReference);
  169. EXTERN_API_C( OSStatus )
  170. FNSReferenceMatchFonts          (FNSFontReference       iReference,
  171.                                  FNSMatchOptions        iMatchOptions,
  172.                                  ItemCount              iOutputSize,
  173.                                  FMFont                 oFonts[], /* can be NULL */
  174.                                  ItemCount *            oNumMatches) /* can be NULL */;
  175. /* Mapping to and from Font Families */
  176. EXTERN_API_C( OSStatus )
  177. FNSReferenceCreateFromFamily    (FMFontFamily           iFamily,
  178.                                  FMFontStyle            iStyle,
  179.                                  FNSObjectVersion       iDesiredVersion,
  180.                                  FNSFontReference *     oReference, /* can be NULL */
  181.                                  FMFontStyle *          oActualStyle) /* can be NULL */;
  182. EXTERN_API_C( OSStatus )
  183. FNSReferenceMatchFamilies       (FNSFontReference       iReference,
  184.                                  FNSMatchOptions        iMatchOptions,
  185.                                  ItemCount              iOutputSize,
  186.                                  FMFontFamilyInstance   oFonts[], /* can be NULL */
  187.                                  ItemCount *            oNumMatches) /* can be NULL */;
  188. /* UI Support */
  189. EXTERN_API_C( OSStatus )
  190. FNSReferenceGetFamilyInfo       (FNSFontReference       iReference,
  191.                                  Str255                 oFamilyName, /* can be NULL */
  192.                                  ScriptCode *           oFamilyNameScript, /* can be NULL */
  193.                                  FMFontStyle *          oActualStyle) /* can be NULL */;
  194. EXTERN_API_C( OSStatus )
  195. FNSReferenceCountNames          (FNSFontReference       iReference,
  196.                                  ItemCount *            oNameCount);
  197. EXTERN_API_C( OSStatus )
  198. FNSReferenceGetIndName          (FNSFontReference       iReference,
  199.                                  ItemCount              iFontNameIndex,
  200.                                  ByteCount              iMaximumNameLength,
  201.                                  Ptr                    oName, /* can be NULL */
  202.                                  ByteCount *            oActualNameLength, /* can be NULL */
  203.                                  FontNameCode *         oFontNameCode, /* can be NULL */
  204.                                  FontPlatformCode *     oFontNamePlatform, /* can be NULL */
  205.                                  FontScriptCode *       oFontNameScript, /* can be NULL */
  206.                                  FontLanguageCode *     oFontNameLanguage) /* can be NULL */;
  207. EXTERN_API_C( OSStatus )
  208. FNSReferenceFindName            (FNSFontReference       iReference,
  209.                                  FontNameCode           iFontNameCode,
  210.                                  FontPlatformCode       iFontNamePlatform,
  211.                                  FontScriptCode         iFontNameScript,
  212.                                  FontLanguageCode       iFontNameLanguage,
  213.                                  ByteCount              iMaximumNameLength,
  214.                                  Ptr                    oName, /* can be NULL */
  215.                                  ByteCount *            oActualNameLength, /* can be NULL */
  216.                                  ItemCount *            oFontNameIndex) /* can be NULL */;
  217. /* Miscellany */
  218. #if CALL_NOT_IN_CARBON
  219. EXTERN_API_C( Boolean )
  220. FNSEnabled                      (void);
  221. #endif  /* CALL_NOT_IN_CARBON */
  222. #if PRAGMA_STRUCT_ALIGN
  223.     #pragma options align=reset
  224. #elif PRAGMA_STRUCT_PACKPUSH
  225.     #pragma pack(pop)
  226. #elif PRAGMA_STRUCT_PACK
  227.     #pragma pack()
  228. #endif
  229. #ifdef PRAGMA_IMPORT_OFF
  230. #pragma import off
  231. #elif PRAGMA_IMPORT
  232. #pragma import reset
  233. #endif
  234. #ifdef __cplusplus
  235. }
  236. #endif
  237. #endif /* __FONTSYNC__ */