~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/opentype/ftxopen.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************
 
2
 *
 
3
 *  ftxopen.h
 
4
 *
 
5
 *    TrueType Open support.
 
6
 *
 
7
 *  Copyright 1996-2000 by
 
8
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 
9
 *
 
10
 *  This file is part of the FreeType project, and may only be used
 
11
 *  modified and distributed under the terms of the FreeType project
 
12
 *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
 
13
 *  this file you indicate that you have read the license and
 
14
 *  understand and accept it fully.
 
15
 *
 
16
 *  This file should be included by the application.  Nevertheless,
 
17
 *  the table specific APIs (and structures) are located in files like
 
18
 *  ftxgsub.h or ftxgpos.h; these header files are read by ftxopen.h .
 
19
 *
 
20
 ******************************************************************/
 
21
 
 
22
#ifndef FTXOPEN_H
 
23
#define FTXOPEN_H
 
24
 
 
25
#include <ft2build.h>
 
26
#include FT_FREETYPE_H
 
27
 
 
28
#ifdef __cplusplus
 
29
extern "C" {
 
30
#endif
 
31
 
 
32
#ifndef EXPORT_DEF
 
33
#define EXPORT_DEF
 
34
#endif
 
35
#ifndef EXPORT_FUNC
 
36
#define EXPORT_FUNC
 
37
#endif
 
38
 
 
39
#define TTO_MAX_NESTING_LEVEL  100
 
40
 
 
41
#define TTO_Err_Invalid_SubTable_Format   0x1000
 
42
#define TTO_Err_Invalid_SubTable          0x1001
 
43
#define TTO_Err_Not_Covered               0x1002
 
44
#define TTO_Err_Too_Many_Nested_Contexts  0x1003
 
45
#define TTO_Err_No_MM_Interpreter         0x1004
 
46
 
 
47
 
 
48
  /* Script list related structures */
 
49
 
 
50
  struct  TTO_LangSys_
 
51
  {
 
52
    FT_UShort   LookupOrderOffset;      /* always 0 for TT Open 1.0  */
 
53
    FT_UShort   ReqFeatureIndex;        /* required FeatureIndex     */
 
54
    FT_UShort   FeatureCount;           /* number of Feature indices */
 
55
    FT_UShort*  FeatureIndex;           /* array of Feature indices  */
 
56
  };
 
57
 
 
58
  typedef struct TTO_LangSys_  TTO_LangSys;
 
59
 
 
60
 
 
61
  struct  TTO_LangSysRecord_
 
62
  {
 
63
    FT_ULong     LangSysTag;            /* LangSysTag identifier */
 
64
    TTO_LangSys  LangSys;               /* LangSys table         */
 
65
  };
 
66
 
 
67
  typedef struct TTO_LangSysRecord_  TTO_LangSysRecord;
 
68
 
 
69
 
 
70
  struct  TTO_Script_
 
71
  {
 
72
    TTO_LangSys         DefaultLangSys; /* DefaultLangSys table     */
 
73
    FT_UShort           LangSysCount;   /* number of LangSysRecords */
 
74
    TTO_LangSysRecord*  LangSysRecord;  /* array of LangSysRecords  */
 
75
  };
 
76
 
 
77
  typedef struct TTO_Script_  TTO_Script;
 
78
 
 
79
 
 
80
  struct  TTO_ScriptRecord_
 
81
  {
 
82
    FT_ULong    ScriptTag;              /* ScriptTag identifier */
 
83
    TTO_Script  Script;                 /* Script table         */
 
84
  };
 
85
 
 
86
  typedef struct TTO_ScriptRecord_  TTO_ScriptRecord;
 
87
 
 
88
 
 
89
  struct  TTO_ScriptList_
 
90
  {
 
91
    FT_UShort          ScriptCount;     /* number of ScriptRecords */
 
92
    TTO_ScriptRecord*  ScriptRecord;    /* array of ScriptRecords  */
 
93
  };
 
94
 
 
95
  typedef struct TTO_ScriptList_  TTO_ScriptList;
 
96
 
 
97
 
 
98
  /* Feature list related structures */
 
99
 
 
100
  struct TTO_Feature_
 
101
  {
 
102
    FT_UShort   FeatureParams;          /* always 0 for TT Open 1.0     */
 
103
    FT_UShort   LookupListCount;        /* number of LookupList indices */
 
104
    FT_UShort*  LookupListIndex;        /* array of LookupList indices  */
 
105
  };
 
106
 
 
107
  typedef struct TTO_Feature_  TTO_Feature;
 
108
 
 
109
 
 
110
  struct  TTO_FeatureRecord_
 
111
  {
 
112
    FT_ULong     FeatureTag;            /* FeatureTag identifier */
 
113
    TTO_Feature  Feature;               /* Feature table         */
 
114
  };
 
115
 
 
116
  typedef struct TTO_FeatureRecord_  TTO_FeatureRecord;
 
117
 
 
118
 
 
119
  struct  TTO_FeatureList_
 
120
  {
 
121
    FT_UShort           FeatureCount;   /* number of FeatureRecords */
 
122
    TTO_FeatureRecord*  FeatureRecord;  /* array of FeatureRecords  */
 
123
  };
 
124
 
 
125
  typedef struct TTO_FeatureList_  TTO_FeatureList;
 
126
 
 
127
 
 
128
  /* Lookup list related structures */
 
129
 
 
130
  struct  TTO_SubTable_;                /* defined below after inclusion
 
131
                                           of ftxgsub.h and ftxgpos.h    */
 
132
  typedef struct TTO_SubTable_  TTO_SubTable;
 
133
 
 
134
 
 
135
  struct  TTO_Lookup_
 
136
  {
 
137
    FT_UShort      LookupType;          /* Lookup type         */
 
138
    FT_UShort      LookupFlag;          /* Lookup qualifiers   */
 
139
    FT_UShort      SubTableCount;       /* number of SubTables */
 
140
    TTO_SubTable*  SubTable;            /* array of SubTables  */
 
141
  };
 
142
 
 
143
  typedef struct TTO_Lookup_  TTO_Lookup;
 
144
 
 
145
 
 
146
  /* The `Properties' field is not defined in the TTO specification but
 
147
     is needed for processing lookups.  If properties[n] is > 0, the
 
148
     functions TT_GSUB_Apply_String() resp. TT_GPOS_Apply_String() will
 
149
     process Lookup[n] for glyphs which have the specific bit not set in
 
150
     the `properties' field of the input string object.                  */
 
151
 
 
152
  struct  TTO_LookupList_
 
153
  {
 
154
    FT_UShort    LookupCount;           /* number of Lookups       */
 
155
    TTO_Lookup*  Lookup;                /* array of Lookup records */
 
156
  };
 
157
 
 
158
  typedef struct TTO_LookupList_  TTO_LookupList;
 
159
 
 
160
 
 
161
  /* Possible LookupFlag bit masks.  `IGNORE_SPECIAL_MARKS' comes from the
 
162
     OpenType 1.2 specification; RIGHT_TO_LEFT has been (re)introduced in
 
163
     OpenType 1.3 -- if set, the last glyph in a cursive attachment
 
164
     sequence has to be positioned on the baseline -- regardless of the
 
165
     writing direction.                                                    */
 
166
 
 
167
#define RIGHT_TO_LEFT         0x0001
 
168
#define IGNORE_BASE_GLYPHS    0x0002
 
169
#define IGNORE_LIGATURES      0x0004
 
170
#define IGNORE_MARKS          0x0008
 
171
#define IGNORE_SPECIAL_MARKS  0xFF00
 
172
 
 
173
 
 
174
  struct  TTO_CoverageFormat1_
 
175
  {
 
176
    FT_UShort   GlyphCount;             /* number of glyphs in GlyphArray */
 
177
    FT_UShort*  GlyphArray;             /* array of glyph IDs             */
 
178
  };
 
179
 
 
180
  typedef struct TTO_CoverageFormat1_  TTO_CoverageFormat1;
 
181
 
 
182
 
 
183
  struct TTO_RangeRecord_
 
184
  {
 
185
    FT_UShort  Start;                   /* first glyph ID in the range */
 
186
    FT_UShort  End;                     /* last glyph ID in the range  */
 
187
    FT_UShort  StartCoverageIndex;      /* coverage index of first
 
188
                                           glyph ID in the range       */
 
189
  };
 
190
 
 
191
  typedef struct TTO_RangeRecord_  TTO_RangeRecord;
 
192
 
 
193
 
 
194
  struct  TTO_CoverageFormat2_
 
195
  {
 
196
    FT_UShort         RangeCount;       /* number of RangeRecords */
 
197
    TTO_RangeRecord*  RangeRecord;      /* array of RangeRecords  */
 
198
  };
 
199
 
 
200
  typedef struct TTO_CoverageFormat2_  TTO_CoverageFormat2;
 
201
 
 
202
 
 
203
  struct  TTO_Coverage_
 
204
  {
 
205
    FT_UShort  CoverageFormat;          /* 1 or 2 */
 
206
 
 
207
    union
 
208
    {
 
209
      TTO_CoverageFormat1  cf1;
 
210
      TTO_CoverageFormat2  cf2;
 
211
    } cf;
 
212
  };
 
213
 
 
214
  typedef struct TTO_Coverage_  TTO_Coverage;
 
215
 
 
216
 
 
217
  struct  TTO_ClassDefFormat1_
 
218
  {
 
219
    FT_UShort   StartGlyph;             /* first glyph ID of the
 
220
                                           ClassValueArray             */
 
221
    FT_UShort   GlyphCount;             /* size of the ClassValueArray */
 
222
    FT_UShort*  ClassValueArray;        /* array of class values       */
 
223
  };
 
224
 
 
225
  typedef struct TTO_ClassDefFormat1_  TTO_ClassDefFormat1;
 
226
 
 
227
 
 
228
  struct  TTO_ClassRangeRecord_
 
229
  {
 
230
    FT_UShort  Start;                   /* first glyph ID in the range    */
 
231
    FT_UShort  End;                     /* last glyph ID in the range     */
 
232
    FT_UShort  Class;                   /* applied to all glyphs in range */
 
233
  };
 
234
 
 
235
  typedef struct TTO_ClassRangeRecord_  TTO_ClassRangeRecord;
 
236
 
 
237
 
 
238
  struct  TTO_ClassDefFormat2_
 
239
  {
 
240
    FT_UShort              ClassRangeCount;
 
241
                                        /* number of ClassRangeRecords */
 
242
    TTO_ClassRangeRecord*  ClassRangeRecord;
 
243
                                        /* array of ClassRangeRecords  */
 
244
  };
 
245
 
 
246
  typedef struct TTO_ClassDefFormat2_  TTO_ClassDefFormat2;
 
247
 
 
248
 
 
249
  /* The `Defined' field is not defined in the TTO specification but
 
250
     apparently needed for processing fonts like trado.ttf: This font
 
251
     refers to a class which contains not a single element.  We map such
 
252
     classes to class 0.                                                 */
 
253
 
 
254
  struct  TTO_ClassDefinition_
 
255
  {
 
256
    FT_Bool    loaded;
 
257
 
 
258
    FT_Bool*   Defined;                 /* array of Booleans.
 
259
                                           If Defined[n] is FALSE,
 
260
                                           class n contains no glyphs. */
 
261
    FT_UShort  ClassFormat;             /* 1 or 2                      */
 
262
 
 
263
    union
 
264
    {
 
265
      TTO_ClassDefFormat1  cd1;
 
266
      TTO_ClassDefFormat2  cd2;
 
267
    } cd;
 
268
  };
 
269
 
 
270
  typedef struct TTO_ClassDefinition_  TTO_ClassDefinition;
 
271
 
 
272
 
 
273
  struct TTO_Device_
 
274
  {
 
275
    FT_UShort   StartSize;              /* smallest size to correct      */
 
276
    FT_UShort   EndSize;                /* largest size to correct       */
 
277
    FT_UShort   DeltaFormat;            /* DeltaValue array data format:
 
278
                                           1, 2, or 3                    */
 
279
    FT_UShort*  DeltaValue;             /* array of compressed data      */
 
280
  };
 
281
 
 
282
  typedef struct TTO_Device_  TTO_Device;
 
283
 
 
284
 
 
285
#include "ftxgdef.h"
 
286
#include "ftxgsub.h"
 
287
#include "ftxgpos.h"
 
288
 
 
289
 
 
290
  struct  TTO_SubTable_
 
291
  {
 
292
    union
 
293
    {
 
294
      TTO_GSUB_SubTable  gsub;
 
295
      TTO_GPOS_SubTable  gpos;
 
296
    } st;
 
297
  };
 
298
 
 
299
 
 
300
  enum  TTO_Type_
 
301
  {
 
302
    GSUB,
 
303
    GPOS
 
304
  };
 
305
 
 
306
  typedef enum TTO_Type_  TTO_Type;
 
307
 
 
308
 
 
309
#ifdef __cplusplus
 
310
}
 
311
#endif
 
312
 
 
313
#endif /* FTXOPEN_H */
 
314
 
 
315
 
 
316
/* END */