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

« back to all changes in this revision

Viewing changes to src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-10-12 23:14:14 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20061012231414-y2oqbom5dy389os0
Tags: upstream-4.2.0
ImportĀ upstreamĀ versionĀ 4.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************
 
2
 *
 
3
 *  Copyright 1996-2000 by
 
4
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 
5
 *
 
6
 *  Copyright 2006  Behdad Esfahbod
 
7
 *
 
8
 *  This is part of HarfBuzz, an OpenType Layout engine library.
 
9
 *
 
10
 *  See the file name COPYING for licensing information.
 
11
 *
 
12
 ******************************************************************/
 
13
#ifndef HARFBUZZ_GSUB_PRIVATE_H
 
14
#define HARFBUZZ_GSUB_PRIVATE_H
 
15
 
 
16
#include "harfbuzz-gsub.h"
 
17
 
 
18
FT_BEGIN_HEADER
 
19
 
 
20
 
 
21
typedef union HB_GSUB_SubTable_  HB_GSUB_SubTable;
 
22
 
 
23
/* LookupType 1 */
 
24
 
 
25
struct  HB_SingleSubstFormat1_
 
26
{
 
27
  FT_Short  DeltaGlyphID;             /* constant added to get
 
28
                                         substitution glyph index */
 
29
};
 
30
 
 
31
typedef struct HB_SingleSubstFormat1_  HB_SingleSubstFormat1;
 
32
 
 
33
 
 
34
struct  HB_SingleSubstFormat2_
 
35
{
 
36
  FT_UShort   GlyphCount;             /* number of glyph IDs in
 
37
                                         Substitute array              */
 
38
  FT_UShort*  Substitute;             /* array of substitute glyph IDs */
 
39
};
 
40
 
 
41
typedef struct HB_SingleSubstFormat2_  HB_SingleSubstFormat2;
 
42
 
 
43
 
 
44
struct  HB_SingleSubst_
 
45
{
 
46
  FT_UShort     SubstFormat;          /* 1 or 2         */
 
47
  HB_Coverage  Coverage;             /* Coverage table */
 
48
 
 
49
  union
 
50
  {
 
51
    HB_SingleSubstFormat1  ssf1;
 
52
    HB_SingleSubstFormat2  ssf2;
 
53
  } ssf;
 
54
};
 
55
 
 
56
typedef struct HB_SingleSubst_  HB_SingleSubst;
 
57
 
 
58
 
 
59
/* LookupType 2 */
 
60
 
 
61
struct  HB_Sequence_
 
62
{
 
63
  FT_UShort   GlyphCount;             /* number of glyph IDs in the
 
64
                                         Substitute array           */
 
65
  FT_UShort*  Substitute;             /* string of glyph IDs to
 
66
                                         substitute                 */
 
67
};
 
68
 
 
69
typedef struct HB_Sequence_  HB_Sequence;
 
70
 
 
71
 
 
72
struct  HB_MultipleSubst_
 
73
{
 
74
  FT_UShort      SubstFormat;         /* always 1                  */
 
75
  HB_Coverage   Coverage;            /* Coverage table            */
 
76
  FT_UShort      SequenceCount;       /* number of Sequence tables */
 
77
  HB_Sequence*  Sequence;            /* array of Sequence tables  */
 
78
};
 
79
 
 
80
typedef struct HB_MultipleSubst_  HB_MultipleSubst;
 
81
 
 
82
 
 
83
/* LookupType 3 */
 
84
 
 
85
struct  HB_AlternateSet_
 
86
{
 
87
  FT_UShort   GlyphCount;             /* number of glyph IDs in the
 
88
                                         Alternate array              */
 
89
  FT_UShort*  Alternate;              /* array of alternate glyph IDs */
 
90
};
 
91
 
 
92
typedef struct HB_AlternateSet_  HB_AlternateSet;
 
93
 
 
94
 
 
95
struct  HB_AlternateSubst_
 
96
{
 
97
  FT_UShort          SubstFormat;     /* always 1                      */
 
98
  HB_Coverage       Coverage;        /* Coverage table                */
 
99
  FT_UShort          AlternateSetCount;
 
100
                                      /* number of AlternateSet tables */
 
101
  HB_AlternateSet*  AlternateSet;    /* array of AlternateSet tables  */
 
102
};
 
103
 
 
104
typedef struct HB_AlternateSubst_  HB_AlternateSubst;
 
105
 
 
106
 
 
107
/* LookupType 4 */
 
108
 
 
109
struct  HB_Ligature_
 
110
{
 
111
  FT_UShort   LigGlyph;               /* glyphID of ligature
 
112
                                         to substitute                    */
 
113
  FT_UShort   ComponentCount;         /* number of components in ligature */
 
114
  FT_UShort*  Component;              /* array of component glyph IDs     */
 
115
};
 
116
 
 
117
typedef struct HB_Ligature_  HB_Ligature;
 
118
 
 
119
 
 
120
struct  HB_LigatureSet_
 
121
{
 
122
  FT_UShort      LigatureCount;       /* number of Ligature tables */
 
123
  HB_Ligature*  Ligature;            /* array of Ligature tables  */
 
124
};
 
125
 
 
126
typedef struct HB_LigatureSet_  HB_LigatureSet;
 
127
 
 
128
 
 
129
struct  HB_LigatureSubst_
 
130
{
 
131
  FT_UShort         SubstFormat;      /* always 1                     */
 
132
  HB_Coverage      Coverage;         /* Coverage table               */
 
133
  FT_UShort         LigatureSetCount; /* number of LigatureSet tables */
 
134
  HB_LigatureSet*  LigatureSet;      /* array of LigatureSet tables  */
 
135
};
 
136
 
 
137
typedef struct HB_LigatureSubst_  HB_LigatureSubst;
 
138
 
 
139
 
 
140
/* needed by both lookup type 5 and 6 */
 
141
 
 
142
struct  HB_SubstLookupRecord_
 
143
{
 
144
  FT_UShort  SequenceIndex;           /* index into current
 
145
                                         glyph sequence               */
 
146
  FT_UShort  LookupListIndex;         /* Lookup to apply to that pos. */
 
147
};
 
148
 
 
149
typedef struct HB_SubstLookupRecord_  HB_SubstLookupRecord;
 
150
 
 
151
 
 
152
/* LookupType 5 */
 
153
 
 
154
struct  HB_SubRule_
 
155
{
 
156
  FT_UShort               GlyphCount; /* total number of input glyphs */
 
157
  FT_UShort               SubstCount; /* number of SubstLookupRecord
 
158
                                         tables                       */
 
159
  FT_UShort*              Input;      /* array of input glyph IDs     */
 
160
  HB_SubstLookupRecord*  SubstLookupRecord;
 
161
                                      /* array of SubstLookupRecord
 
162
                                         tables                       */
 
163
};
 
164
 
 
165
typedef struct HB_SubRule_  HB_SubRule;
 
166
 
 
167
 
 
168
struct  HB_SubRuleSet_
 
169
{
 
170
  FT_UShort     SubRuleCount;         /* number of SubRule tables */
 
171
  HB_SubRule*  SubRule;              /* array of SubRule tables  */
 
172
};
 
173
 
 
174
typedef struct HB_SubRuleSet_  HB_SubRuleSet;
 
175
 
 
176
 
 
177
struct  HB_ContextSubstFormat1_
 
178
{
 
179
  HB_Coverage     Coverage;          /* Coverage table              */
 
180
  FT_UShort        SubRuleSetCount;   /* number of SubRuleSet tables */
 
181
  HB_SubRuleSet*  SubRuleSet;        /* array of SubRuleSet tables  */
 
182
};
 
183
 
 
184
typedef struct HB_ContextSubstFormat1_  HB_ContextSubstFormat1;
 
185
 
 
186
 
 
187
struct  HB_SubClassRule_
 
188
{
 
189
  FT_UShort               GlyphCount; /* total number of context classes */
 
190
  FT_UShort               SubstCount; /* number of SubstLookupRecord
 
191
                                         tables                          */
 
192
  FT_UShort*              Class;      /* array of classes                */
 
193
  HB_SubstLookupRecord*  SubstLookupRecord;
 
194
                                      /* array of SubstLookupRecord
 
195
                                         tables                          */
 
196
};
 
197
 
 
198
typedef struct HB_SubClassRule_  HB_SubClassRule;
 
199
 
 
200
 
 
201
struct  HB_SubClassSet_
 
202
{
 
203
  FT_UShort          SubClassRuleCount;
 
204
                                      /* number of SubClassRule tables */
 
205
  HB_SubClassRule*  SubClassRule;    /* array of SubClassRule tables  */
 
206
};
 
207
 
 
208
typedef struct HB_SubClassSet_  HB_SubClassSet;
 
209
 
 
210
 
 
211
/* The `MaxContextLength' field is not defined in the TTO specification
 
212
   but simplifies the implementation of this format.  It holds the
 
213
   maximal context length used in the context rules.                    */
 
214
 
 
215
struct  HB_ContextSubstFormat2_
 
216
{
 
217
  FT_UShort            MaxContextLength;
 
218
                                      /* maximal context length       */
 
219
  HB_Coverage         Coverage;      /* Coverage table               */
 
220
  HB_ClassDefinition  ClassDef;      /* ClassDef table               */
 
221
  FT_UShort            SubClassSetCount;
 
222
                                      /* number of SubClassSet tables */
 
223
  HB_SubClassSet*     SubClassSet;   /* array of SubClassSet tables  */
 
224
};
 
225
 
 
226
typedef struct HB_ContextSubstFormat2_  HB_ContextSubstFormat2;
 
227
 
 
228
 
 
229
struct  HB_ContextSubstFormat3_
 
230
{
 
231
  FT_UShort               GlyphCount; /* number of input glyphs        */
 
232
  FT_UShort               SubstCount; /* number of SubstLookupRecords  */
 
233
  HB_Coverage*           Coverage;   /* array of Coverage tables      */
 
234
  HB_SubstLookupRecord*  SubstLookupRecord;
 
235
                                      /* array of substitution lookups */
 
236
};
 
237
 
 
238
typedef struct HB_ContextSubstFormat3_  HB_ContextSubstFormat3;
 
239
 
 
240
 
 
241
struct  HB_ContextSubst_
 
242
{
 
243
  FT_UShort  SubstFormat;             /* 1, 2, or 3 */
 
244
 
 
245
  union
 
246
  {
 
247
    HB_ContextSubstFormat1  csf1;
 
248
    HB_ContextSubstFormat2  csf2;
 
249
    HB_ContextSubstFormat3  csf3;
 
250
  } csf;
 
251
};
 
252
 
 
253
typedef struct HB_ContextSubst_  HB_ContextSubst;
 
254
 
 
255
 
 
256
/* LookupType 6 */
 
257
 
 
258
struct  HB_ChainSubRule_
 
259
{
 
260
  FT_UShort               BacktrackGlyphCount;
 
261
                                      /* total number of backtrack glyphs */
 
262
  FT_UShort*              Backtrack;  /* array of backtrack glyph IDs     */
 
263
  FT_UShort               InputGlyphCount;
 
264
                                      /* total number of input glyphs     */
 
265
  FT_UShort*              Input;      /* array of input glyph IDs         */
 
266
  FT_UShort               LookaheadGlyphCount;
 
267
                                      /* total number of lookahead glyphs */
 
268
  FT_UShort*              Lookahead;  /* array of lookahead glyph IDs     */
 
269
  FT_UShort               SubstCount; /* number of SubstLookupRecords     */
 
270
  HB_SubstLookupRecord*  SubstLookupRecord;
 
271
                                      /* array of SubstLookupRecords      */
 
272
};
 
273
 
 
274
typedef struct HB_ChainSubRule_  HB_ChainSubRule;
 
275
 
 
276
 
 
277
struct  HB_ChainSubRuleSet_
 
278
{
 
279
  FT_UShort          ChainSubRuleCount;
 
280
                                      /* number of ChainSubRule tables */
 
281
  HB_ChainSubRule*  ChainSubRule;    /* array of ChainSubRule tables  */
 
282
};
 
283
 
 
284
typedef struct HB_ChainSubRuleSet_  HB_ChainSubRuleSet;
 
285
 
 
286
 
 
287
struct  HB_ChainContextSubstFormat1_
 
288
{
 
289
  HB_Coverage          Coverage;     /* Coverage table                   */
 
290
  FT_UShort             ChainSubRuleSetCount;
 
291
                                      /* number of ChainSubRuleSet tables */
 
292
  HB_ChainSubRuleSet*  ChainSubRuleSet;
 
293
                                      /* array of ChainSubRuleSet tables  */
 
294
};
 
295
 
 
296
typedef struct HB_ChainContextSubstFormat1_  HB_ChainContextSubstFormat1;
 
297
 
 
298
 
 
299
struct  HB_ChainSubClassRule_
 
300
{
 
301
  FT_UShort               BacktrackGlyphCount;
 
302
                                      /* total number of backtrack
 
303
                                         classes                         */
 
304
  FT_UShort*              Backtrack;  /* array of backtrack classes      */
 
305
  FT_UShort               InputGlyphCount;
 
306
                                      /* total number of context classes */
 
307
  FT_UShort*              Input;      /* array of context classes        */
 
308
  FT_UShort               LookaheadGlyphCount;
 
309
                                      /* total number of lookahead
 
310
                                         classes                         */
 
311
  FT_UShort*              Lookahead;  /* array of lookahead classes      */
 
312
  FT_UShort               SubstCount; /* number of SubstLookupRecords    */
 
313
  HB_SubstLookupRecord*  SubstLookupRecord;
 
314
                                      /* array of substitution lookups   */
 
315
};
 
316
 
 
317
typedef struct HB_ChainSubClassRule_  HB_ChainSubClassRule;
 
318
 
 
319
 
 
320
struct  HB_ChainSubClassSet_
 
321
{
 
322
  FT_UShort               ChainSubClassRuleCount;
 
323
                                      /* number of ChainSubClassRule
 
324
                                         tables                      */
 
325
  HB_ChainSubClassRule*  ChainSubClassRule;
 
326
                                      /* array of ChainSubClassRule
 
327
                                         tables                      */
 
328
};
 
329
 
 
330
typedef struct HB_ChainSubClassSet_  HB_ChainSubClassSet;
 
331
 
 
332
 
 
333
/* The `MaxXXXLength' fields are not defined in the TTO specification
 
334
   but simplifies the implementation of this format.  It holds the
 
335
   maximal context length used in the specific context rules.         */
 
336
 
 
337
struct  HB_ChainContextSubstFormat2_
 
338
{
 
339
  HB_Coverage           Coverage;    /* Coverage table             */
 
340
 
 
341
  FT_UShort              MaxBacktrackLength;
 
342
                                      /* maximal backtrack length   */
 
343
  HB_ClassDefinition    BacktrackClassDef;
 
344
                                      /* BacktrackClassDef table    */
 
345
  FT_UShort              MaxInputLength;
 
346
                                      /* maximal input length       */
 
347
  HB_ClassDefinition    InputClassDef;
 
348
                                      /* InputClassDef table        */
 
349
  FT_UShort              MaxLookaheadLength;
 
350
                                      /* maximal lookahead length   */
 
351
  HB_ClassDefinition    LookaheadClassDef;
 
352
                                      /* LookaheadClassDef table    */
 
353
 
 
354
  FT_UShort              ChainSubClassSetCount;
 
355
                                      /* number of ChainSubClassSet
 
356
                                         tables                     */
 
357
  HB_ChainSubClassSet*  ChainSubClassSet;
 
358
                                      /* array of ChainSubClassSet
 
359
                                         tables                     */
 
360
};
 
361
 
 
362
typedef struct HB_ChainContextSubstFormat2_  HB_ChainContextSubstFormat2;
 
363
 
 
364
 
 
365
struct  HB_ChainContextSubstFormat3_
 
366
{
 
367
  FT_UShort               BacktrackGlyphCount;
 
368
                                      /* number of backtrack glyphs    */
 
369
  HB_Coverage*           BacktrackCoverage;
 
370
                                      /* array of backtrack Coverage
 
371
                                         tables                        */
 
372
  FT_UShort               InputGlyphCount;
 
373
                                      /* number of input glyphs        */
 
374
  HB_Coverage*           InputCoverage;
 
375
                                      /* array of input coverage
 
376
                                         tables                        */
 
377
  FT_UShort               LookaheadGlyphCount;
 
378
                                      /* number of lookahead glyphs    */
 
379
  HB_Coverage*           LookaheadCoverage;
 
380
                                      /* array of lookahead coverage
 
381
                                         tables                        */
 
382
  FT_UShort               SubstCount; /* number of SubstLookupRecords  */
 
383
  HB_SubstLookupRecord*  SubstLookupRecord;
 
384
                                      /* array of substitution lookups */
 
385
};
 
386
 
 
387
typedef struct HB_ChainContextSubstFormat3_  HB_ChainContextSubstFormat3;
 
388
 
 
389
 
 
390
struct  HB_ChainContextSubst_
 
391
{
 
392
  FT_UShort  SubstFormat;             /* 1, 2, or 3 */
 
393
 
 
394
  union
 
395
  {
 
396
    HB_ChainContextSubstFormat1  ccsf1;
 
397
    HB_ChainContextSubstFormat2  ccsf2;
 
398
    HB_ChainContextSubstFormat3  ccsf3;
 
399
  } ccsf;
 
400
};
 
401
 
 
402
typedef struct HB_ChainContextSubst_  HB_ChainContextSubst;
 
403
 
 
404
 
 
405
/* LookupType 8 */
 
406
struct HB_ReverseChainContextSubst_
 
407
{
 
408
  FT_UShort      SubstFormat;         /* always 1 */
 
409
  HB_Coverage   Coverage;               /* coverage table for input glyphs */
 
410
  FT_UShort      BacktrackGlyphCount; /* number of backtrack glyphs      */
 
411
  HB_Coverage*  BacktrackCoverage;   /* array of backtrack Coverage
 
412
                                         tables                          */
 
413
  FT_UShort      LookaheadGlyphCount; /* number of lookahead glyphs      */
 
414
  HB_Coverage*  LookaheadCoverage;   /* array of lookahead Coverage
 
415
                                         tables                          */
 
416
  FT_UShort      GlyphCount;          /* number of Glyph IDs             */
 
417
  FT_UShort*     Substitute;          /* array of substitute Glyph ID    */
 
418
};
 
419
 
 
420
typedef struct HB_ReverseChainContextSubst_  HB_ReverseChainContextSubst;
 
421
 
 
422
 
 
423
union  HB_GSUB_SubTable_
 
424
{
 
425
  HB_SingleSubst              single;
 
426
  HB_MultipleSubst            multiple;
 
427
  HB_AlternateSubst           alternate;
 
428
  HB_LigatureSubst            ligature;
 
429
  HB_ContextSubst             context;
 
430
  HB_ChainContextSubst        chain;
 
431
  HB_ReverseChainContextSubst reverse;
 
432
};
 
433
 
 
434
 
 
435
 
 
436
 
 
437
 
 
438
FT_Error  _HB_GSUB_Load_SubTable( HB_GSUB_SubTable*  st,
 
439
                                  FT_Stream     stream,
 
440
                                  FT_UShort     lookup_type );
 
441
 
 
442
void  _HB_GSUB_Free_SubTable( HB_GSUB_SubTable*  st,
 
443
                              FT_Memory     memory,
 
444
                              FT_UShort     lookup_type );
 
445
 
 
446
FT_END_HEADER
 
447
 
 
448
#endif /* HARFBUZZ_GSUB_PRIVATE_H */