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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       ScalerStreamTypes.h
  3.  
  4.      Contains:   Scaler streaming data structures and constants for OFA 1.x
  5.  
  6.      Version:    Technology: Quickdraw GX 1.1
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-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 __SCALERSTREAMTYPES__
  18. #define __SCALERSTREAMTYPES__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __SFNTTYPES__
  23. #include "SFNTTypes.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. /* ScalerStream input/output types */
  42. enum {
  43.     cexec68K                    = 0x0001,
  44.     truetypeStreamType          = 0x0001,
  45.     type1StreamType             = 0x0002,
  46.     type3StreamType             = 0x0004,
  47.     type42StreamType            = 0x0008,
  48.     type42GXStreamType          = 0x0010,
  49.     portableStreamType          = 0x0020,
  50.     flattenedStreamType         = 0x0040,
  51.     evenOddModifierStreamType   = 0x8000
  52. };
  53. /* Possible streamed font formats */
  54. typedef unsigned long                   scalerStreamTypeFlag;
  55. enum {
  56.     downloadStreamAction        = 0,                            /* Transmit the (possibly sparse) font data */
  57.     asciiDownloadStreamAction   = 1,                            /* Transmit font data to a 7-bit ASCII destination */
  58.     fontSizeQueryStreamAction   = 2,                            /* Estimate in-printer memory used if the font were downloaded */
  59.     encodingOnlyStreamAction    = 3,                            /* Transmit only the encoding for the font */
  60.     prerequisiteQueryStreamAction = 4,                          /* Return a list of prerequisite items needed for the font */
  61.     prerequisiteItemStreamAction = 5,                           /* Transmit a specified prerequisite item */
  62.     variationQueryStreamAction  = 6,                            /* Return information regarding support for variation streaming */
  63.     variationPSOperatorStreamAction = 7                         /* Transmit Postscript code necessary to effect variation of a font */
  64. };
  65. typedef long                            scalerStreamAction;
  66. enum {
  67.     selectAllVariations         = -1                            /* Special variationCount value meaning include all variation data */
  68. };
  69. struct scalerPrerequisiteItem {
  70.     long                            enumeration;                /* Shorthand tag identifying the item */
  71.     long                            size;                       /* Worst case vm in printer item requires */
  72.     unsigned char                   name[1];                    /* Name to be used by the client when emitting the item (Pascal string) */
  73. };
  74. typedef struct scalerPrerequisiteItem   scalerPrerequisiteItem;
  75. struct scalerStream {
  76.     const void *                    streamRefCon;               /* <- private reference for client */
  77.     const char *                    targetVersion;              /* <- e.g. Postscript printer name (C string) */
  78.     scalerStreamTypeFlag            types;                      /* <->    Data stream formats desired/supplied */
  79.     scalerStreamAction              action;                     /* <-     What action to take */
  80.     unsigned long                   memorySize;                 /* -> Worst case memory use (vm) in printer or as sfnt */
  81.     long                            variationCount;             /* <- The number of variations, or selectAllVariations */
  82.     const void *                    variations;                 /* <- A pointer to an array of the variations (gxFontVariation) */
  83.     union {
  84.                                                                 /* Normal font streaming information*/
  85.         struct {
  86.             const unsigned short *          encoding;           /* <- Intention is * unsigned short[256] */
  87.             long *                          glyphBits;          /* <->    Bitvector: a bit for each glyph, 1 = desired/supplied */
  88.             char *                          name;               /* <->    The printer font name to use/used (C string) */
  89.         }                                 font;
  90.                                                                 /* Used to obtain a list of prerequisites from the scaler*/
  91.         struct {
  92.             long                            size;               /* ->     Size of the prereq. list in bytes (0 indicates no prerequisites)*/
  93.             void *                          list;               /* <- Pointer to client block to hold list (nil = list size query only) */
  94.         }                                 prerequisiteQuery;
  95.         long                            prerequisiteItem;       /* <-     Enumeration value for the prerequisite item to be streamed.*/
  96.         long                            variationQueryResult;   /* -> Output from the variationQueryStreamAction */
  97.     }                                 info;
  98. };
  99. typedef struct scalerStream             scalerStream;
  100. struct scalerStreamData {
  101.     long                            hexFlag;                    /* Indicates that the data is to be interpreted as hex, versus binary */
  102.     long                            byteCount;                  /* Number of bytes in the data being streamed */
  103.     const void *                    data;                       /* Pointer to the data being streamed */
  104. };
  105. typedef struct scalerStreamData         scalerStreamData;
  106. #if PRAGMA_STRUCT_ALIGN
  107.     #pragma options align=reset
  108. #elif PRAGMA_STRUCT_PACKPUSH
  109.     #pragma pack(pop)
  110. #elif PRAGMA_STRUCT_PACK
  111.     #pragma pack()
  112. #endif
  113. #ifdef PRAGMA_IMPORT_OFF
  114. #pragma import off
  115. #elif PRAGMA_IMPORT
  116. #pragma import reset
  117. #endif
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* __SCALERSTREAMTYPES__ */