summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/ScalerStreamTypes.h
blob: 3a26d93f3be91ed2666e9d7c8aa1984c1ad3bc8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
     File:       ScalerStreamTypes.h
 
     Contains:   Scaler streaming data structures and constants for OFA 1.x
 
     Version:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
 
     Bugs?:      For bug reports, consult the following page on
                 the World Wide Web:
 
                     http://developer.apple.com/bugreporter/
 
*/
#ifndef __SCALERSTREAMTYPES__
#define __SCALERSTREAMTYPES__

#ifndef __MACTYPES__
#include <MacTypes.h>
#endif

#ifndef __SFNTTYPES__
#include <SFNTTypes.h>
#endif




#if PRAGMA_ONCE
#pragma once
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
    #pragma pack(2)
#endif

/* ScalerStream input/output types */
enum {
  cexec68K                      = 0x00000001,
  truetypeStreamType            = 0x00000001,
  type1StreamType               = 0x00000002,
  type3StreamType               = 0x00000004,
  type42StreamType              = 0x00000008,
  type42GXStreamType            = 0x00000010,
  portableStreamType            = 0x00000020,
  flattenedStreamType           = 0x00000040,
  cidType2StreamType            = 0x00000080,
  cidType0StreamType            = 0x00000100,
  type1CFFStreamType            = 0x00000200,
  evenOddModifierStreamType     = 0x00008000,
  eexecBinaryModifierStreamType = 0x00010000, /* encrypted portion of Type1Stream to be binary */
  unicodeMappingModifierStreamType = 0x00020000, /* include glyph ID to unicode mapping info for PDF */
  scalerSpecifcModifierMask     = 0x0000F000, /* for scaler's internal use */
  streamTypeModifierMask        = (long)0xFFFFF000 /* 16 bits for Apple, 4 bits for scaler */
};

/* Possible streamed font formats */
typedef unsigned long                   scalerStreamTypeFlag;
enum {
  downloadStreamAction          = 0,    /* Transmit the (possibly sparse) font data */
  asciiDownloadStreamAction     = 1,    /* Transmit font data to a 7-bit ASCII destination */
  fontSizeQueryStreamAction     = 2,    /* Estimate in-printer memory used if the font were downloaded */
  encodingOnlyStreamAction      = 3,    /* Transmit only the encoding for the font */
  prerequisiteQueryStreamAction = 4,    /* Return a list of prerequisite items needed for the font */
  prerequisiteItemStreamAction  = 5,    /* Transmit a specified prerequisite item */
  variationQueryStreamAction    = 6,    /* Return information regarding support for variation streaming */
  variationPSOperatorStreamAction = 7   /* Transmit Postscript code necessary to effect variation of a font */
};

typedef long                            scalerStreamAction;
enum {
  selectAllVariations           = -1    /* Special variationCount value meaning include all variation data */
};

struct scalerPrerequisiteItem {
  long                enumeration;            /* Shorthand tag identifying the item */
  long                size;                   /* Worst case vm in printer item requires */
  unsigned char       name[1];                /* Name to be used by the client when emitting the item (Pascal string) */
};
typedef struct scalerPrerequisiteItem   scalerPrerequisiteItem;
struct scalerStream {
  const void *        streamRefCon;           /* <- private reference for client */
  const char *        targetVersion;          /* <- e.g. Postscript printer name (C string) */
  scalerStreamTypeFlag  types;                /* <->    Data stream formats desired/supplied */
  scalerStreamAction  action;                 /* <-     What action to take */
  unsigned long       memorySize;             /* -> Worst case memory use (vm) in printer or as sfnt */
  long                variationCount;         /* <- The number of variations, or selectAllVariations */
  const void *        variations;             /* <- A pointer to an array of the variations (gxFontVariation) */
  union {
                                              /* Normal font streaming information*/
    struct {
      const unsigned short * encoding;        /* <- Intention is * unsigned short[256] */
      long *              glyphBits;          /* <->    Bitvector: a bit for each glyph, 1 = desired/supplied */
      char *              name;               /* <->    The printer font name to use/used (C string) */
    }                       font;

                                              /* Used to obtain a list of prerequisites from the scaler*/
    struct {
      long                size;               /* ->     Size of the prereq. list in bytes (0 indicates no prerequisites)*/
      void *              list;               /* <- Pointer to client block to hold list (nil = list size query only) */
    }                       prerequisiteQuery;

    long                prerequisiteItem;     /* <-     Enumeration value for the prerequisite item to be streamed.*/

    long                variationQueryResult; /* -> Output from the variationQueryStreamAction */
  }                       info;
};
typedef struct scalerStream             scalerStream;
struct scalerStreamData {
  long                hexFlag;                /* Indicates that the data is to be interpreted as hex, versus binary */
  long                byteCount;              /* Number of bytes in the data being streamed */
  const void *        data;                   /* Pointer to the data being streamed */
};
typedef struct scalerStreamData         scalerStreamData;

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
    #pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif


#endif /* __SCALERSTREAMTYPES__ */