Optimize memory consumption for simple GPOS tables
[profile/ivi/qtbase.git] / src / 3rdparty / harfbuzz / src / harfbuzz-gpos-private.h
1 /*
2  * Copyright (C) 1998-2004  David Turner and Werner Lemberg
3  * Copyright (C) 2006  Behdad Esfahbod
4  *
5  * This is part of HarfBuzz, an OpenType Layout engine library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  */
25
26 #ifndef HARFBUZZ_GPOS_PRIVATE_H
27 #define HARFBUZZ_GPOS_PRIVATE_H
28
29 #include "harfbuzz-impl.h"
30 #include "harfbuzz-stream-private.h"
31 #include "harfbuzz-gpos.h"
32
33 HB_BEGIN_HEADER
34
35 /* shared tables */
36
37 #define VR_X_PLACEMENT_DEVICE 0
38 #define VR_Y_PLACEMENT_DEVICE 1
39 #define VR_X_ADVANCE_DEVICE   2
40 #define VR_Y_ADVANCE_DEVICE   3
41
42 #ifndef HB_SUPPORT_MULTIPLE_MASTER
43 #  define HB_USE_FLEXIBLE_VALUE_RECORD
44 #endif
45
46 struct  HB_ValueRecord_
47 {
48   HB_Short    XPlacement;             /* horizontal adjustment for
49                                          placement                      */
50   HB_Short    YPlacement;             /* vertical adjustment for
51                                          placement                      */
52   HB_Short    XAdvance;               /* horizontal adjustment for
53                                          advance                        */
54   HB_Short    YAdvance;               /* vertical adjustment for
55                                          advance                        */
56
57   HB_Device** DeviceTables;           /* device tables for placement
58                                          and advance                    */
59
60 #ifdef HB_SUPPORT_MULTIPLE_MASTER
61   HB_UShort   XIdPlacement;           /* horizontal placement metric ID */
62   HB_UShort   YIdPlacement;           /* vertical placement metric ID   */
63   HB_UShort   XIdAdvance;             /* horizontal advance metric ID   */
64   HB_UShort   YIdAdvance;             /* vertical advance metric ID     */
65 #endif
66 };
67
68 typedef struct HB_ValueRecord_  HB_ValueRecord;
69
70
71 /* Mask values to scan the value format of the ValueRecord structure.
72  We always expand compressed ValueRecords of the font.              */
73
74 #define HB_GPOS_FORMAT_HAVE_DEVICE_TABLES       0x00F0
75
76 #define HB_GPOS_FORMAT_HAVE_X_PLACEMENT         0x0001
77 #define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT         0x0002
78 #define HB_GPOS_FORMAT_HAVE_X_ADVANCE           0x0004
79 #define HB_GPOS_FORMAT_HAVE_Y_ADVANCE           0x0008
80 #define HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE  0x0010
81 #define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE  0x0020
82 #define HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE    0x0040
83 #define HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE    0x0080
84 #define HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT      0x0100
85 #define HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT      0x0200
86 #define HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE        0x0400
87 #define HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE        0x0800
88
89
90 struct  HB_AnchorFormat1_
91 {
92   HB_Short   XCoordinate;             /* horizontal value */
93   HB_Short   YCoordinate;             /* vertical value   */
94 };
95
96 typedef struct HB_AnchorFormat1_  HB_AnchorFormat1;
97
98
99 struct  HB_AnchorFormat2_
100 {
101   HB_Short   XCoordinate;             /* horizontal value             */
102   HB_Short   YCoordinate;             /* vertical value               */
103   HB_UShort  AnchorPoint;             /* index to glyph contour point */
104 };
105
106 typedef struct HB_AnchorFormat2_  HB_AnchorFormat2;
107
108 #define AF3_X_DEVICE_TABLE 0
109 #define AF3_Y_DEVICE_TABLE 1
110
111 struct  HB_AnchorFormat3_
112 {
113   HB_Short    XCoordinate;            /* horizontal value              */
114   HB_Short    YCoordinate;            /* vertical value                */
115   HB_Device** DeviceTables;           /* device tables for coordinates */
116 };
117
118 typedef struct HB_AnchorFormat3_  HB_AnchorFormat3;
119
120
121 #ifdef HB_SUPPORT_MULTIPLE_MASTER
122 struct  HB_AnchorFormat4_
123 {
124   HB_UShort  XIdAnchor;               /* horizontal metric ID */
125   HB_UShort  YIdAnchor;               /* vertical metric ID   */
126 };
127
128 typedef struct HB_AnchorFormat4_  HB_AnchorFormat4;
129 #endif
130
131
132 struct  HB_Anchor_
133 {
134   HB_Byte  PosFormat;                 /* 1, 2, 3, or 4 -- 0 indicates
135                                          that there is no Anchor table */
136
137   union
138   {
139     HB_AnchorFormat1  af1;
140     HB_AnchorFormat2  af2;
141     HB_AnchorFormat3  af3;
142 #ifdef HB_SUPPORT_MULTIPLE_MASTER
143     HB_AnchorFormat4  af4;
144 #endif
145   } af;
146 };
147
148 typedef struct HB_Anchor_  HB_Anchor;
149
150
151 struct  HB_MarkRecord_
152 {
153   HB_UShort   Class;                  /* mark class   */
154   HB_Anchor  MarkAnchor;             /* anchor table */
155 };
156
157 typedef struct HB_MarkRecord_  HB_MarkRecord;
158
159
160 struct  HB_MarkArray_
161 {
162   HB_UShort        MarkCount;         /* number of MarkRecord tables */
163   HB_MarkRecord*  MarkRecord;        /* array of MarkRecord tables  */
164 };
165
166 typedef struct HB_MarkArray_  HB_MarkArray;
167
168
169 /* LookupType 1 */
170
171 struct  HB_SinglePosFormat1_
172 {
173   HB_ValueRecord  Value;             /* ValueRecord for all covered
174                                          glyphs                      */
175 };
176
177 typedef struct HB_SinglePosFormat1_  HB_SinglePosFormat1;
178
179
180 struct  HB_SinglePosFormat2_
181 {
182   HB_UShort         ValueCount;       /* number of ValueRecord tables */
183   HB_ValueRecord*  Value;            /* array of ValueRecord tables  */
184 };
185
186 typedef struct HB_SinglePosFormat2_  HB_SinglePosFormat2;
187
188
189 struct  HB_SinglePos_
190 {
191   HB_Byte       PosFormat;            /* 1 or 2         */
192   HB_Coverage  Coverage;             /* Coverage table */
193
194   HB_UShort     ValueFormat;          /* format of ValueRecord table */
195
196   union
197   {
198     HB_SinglePosFormat1  spf1;
199     HB_SinglePosFormat2  spf2;
200   } spf;
201 };
202
203 typedef struct HB_SinglePos_  HB_SinglePos;
204
205
206 /* LookupType 2 */
207
208 struct  HB_PairValueRecord_
209 {
210   HB_UShort        SecondGlyph;       /* glyph ID for second glyph  */
211   HB_ValueRecord  Value1;            /* pos. data for first glyph  */
212   HB_ValueRecord  Value2;            /* pos. data for second glyph */
213 };
214
215 typedef struct HB_PairValueRecord_  HB_PairValueRecord;
216
217
218 struct  HB_PairSet_
219 {
220   HB_UShort             PairValueCount;
221                                       /* number of PairValueRecord tables */
222   HB_PairValueRecord*  PairValueRecord;
223                                       /* array of PairValueRecord tables  */
224 };
225
226 typedef struct HB_PairSet_  HB_PairSet;
227
228
229 struct  HB_PairPosFormat1_
230 {
231   HB_UShort     PairSetCount;         /* number of PairSet tables    */
232   HB_PairSet*  PairSet;              /* array of PairSet tables     */
233 };
234
235 typedef struct HB_PairPosFormat1_  HB_PairPosFormat1;
236
237
238 struct  HB_Class2Record_
239 {
240   HB_ValueRecord  Value1;            /* pos. data for first glyph  */
241   HB_ValueRecord  Value2;            /* pos. data for second glyph */
242 };
243
244 typedef struct HB_Class2Record_  HB_Class2Record;
245
246
247 struct  HB_Class1Record_
248 {
249   hb_uint8 IsFlexible;
250   union {
251     HB_Class2Record*  Class2Record;    /* array of Class2Record tables */
252     HB_Short* ValueRecords;
253   } c2r;
254 };
255
256 typedef struct HB_Class1Record_  HB_Class1Record;
257
258
259 struct  HB_PairPosFormat2_
260 {
261   HB_ClassDefinition  ClassDef1;     /* class def. for first glyph     */
262   HB_ClassDefinition  ClassDef2;     /* class def. for second glyph    */
263   HB_UShort            Class1Count;   /* number of classes in ClassDef1
264                                          table                          */
265   HB_UShort            Class2Count;   /* number of classes in ClassDef2
266                                          table                          */
267   HB_Class1Record*    Class1Record;  /* array of Class1Record tables   */
268 };
269
270 typedef struct HB_PairPosFormat2_  HB_PairPosFormat2;
271
272
273 struct  HB_PairPos_
274 {
275   HB_Byte       PosFormat;            /* 1 or 2         */
276   HB_Coverage  Coverage;             /* Coverage table */
277   HB_UShort     ValueFormat1;         /* format of ValueRecord table
278                                          for first glyph             */
279   HB_UShort     ValueFormat2;         /* format of ValueRecord table
280                                          for second glyph            */
281
282   union
283   {
284     HB_PairPosFormat1  ppf1;
285     HB_PairPosFormat2  ppf2;
286   } ppf;
287 };
288
289 typedef struct HB_PairPos_  HB_PairPos;
290
291
292 /* LookupType 3 */
293
294 struct  HB_EntryExitRecord_
295 {
296   HB_Anchor  EntryAnchor;            /* entry Anchor table */
297   HB_Anchor  ExitAnchor;             /* exit Anchor table  */
298 };
299
300
301 typedef struct HB_EntryExitRecord_  HB_EntryExitRecord;
302
303 struct  HB_CursivePos_
304 {
305   HB_UShort             PosFormat;    /* always 1                         */
306   HB_Coverage          Coverage;     /* Coverage table                   */
307   HB_UShort             EntryExitCount;
308                                       /* number of EntryExitRecord tables */
309   HB_EntryExitRecord*  EntryExitRecord;
310                                       /* array of EntryExitRecord tables  */
311 };
312
313 typedef struct HB_CursivePos_  HB_CursivePos;
314
315
316 /* LookupType 4 */
317
318 struct  HB_BaseRecord_
319 {
320   HB_Anchor*  BaseAnchor;            /* array of base glyph anchor
321                                          tables                     */
322 };
323
324 typedef struct HB_BaseRecord_  HB_BaseRecord;
325
326
327 struct  HB_BaseArray_
328 {
329   HB_UShort        BaseCount;         /* number of BaseRecord tables */
330   HB_BaseRecord*  BaseRecord;        /* array of BaseRecord tables  */
331 };
332
333 typedef struct HB_BaseArray_  HB_BaseArray;
334
335
336 struct  HB_MarkBasePos_
337 {
338   HB_UShort      PosFormat;           /* always 1                  */
339   HB_Coverage   MarkCoverage;        /* mark glyph coverage table */
340   HB_Coverage   BaseCoverage;        /* base glyph coverage table */
341   HB_UShort      ClassCount;          /* number of mark classes    */
342   HB_MarkArray  MarkArray;           /* mark array table          */
343   HB_BaseArray  BaseArray;           /* base array table          */
344 };
345
346 typedef struct HB_MarkBasePos_  HB_MarkBasePos;
347
348
349 /* LookupType 5 */
350
351 struct  HB_ComponentRecord_
352 {
353   HB_Anchor*  LigatureAnchor;        /* array of ligature glyph anchor
354                                          tables                         */
355 };
356
357 typedef struct HB_ComponentRecord_  HB_ComponentRecord;
358
359
360 struct  HB_LigatureAttach_
361 {
362   HB_UShort             ComponentCount;
363                                       /* number of ComponentRecord tables */
364   HB_ComponentRecord*  ComponentRecord;
365                                       /* array of ComponentRecord tables  */
366 };
367
368 typedef struct HB_LigatureAttach_  HB_LigatureAttach;
369
370
371 struct  HB_LigatureArray_
372 {
373   HB_UShort            LigatureCount; /* number of LigatureAttach tables */
374   HB_LigatureAttach*  LigatureAttach;
375                                       /* array of LigatureAttach tables  */
376 };
377
378 typedef struct HB_LigatureArray_  HB_LigatureArray;
379
380
381 struct  HB_MarkLigPos_
382 {
383   HB_UShort          PosFormat;       /* always 1                      */
384   HB_Coverage       MarkCoverage;    /* mark glyph coverage table     */
385   HB_Coverage       LigatureCoverage;
386                                       /* ligature glyph coverage table */
387   HB_UShort          ClassCount;      /* number of mark classes        */
388   HB_MarkArray      MarkArray;       /* mark array table              */
389   HB_LigatureArray  LigatureArray;   /* ligature array table          */
390 };
391
392 typedef struct HB_MarkLigPos_  HB_MarkLigPos;
393
394
395 /* LookupType 6 */
396
397 struct  HB_Mark2Record_
398 {
399   HB_Anchor*  Mark2Anchor;           /* array of mark glyph anchor
400                                          tables                     */
401 };
402
403 typedef struct HB_Mark2Record_  HB_Mark2Record;
404
405
406 struct  HB_Mark2Array_
407 {
408   HB_UShort         Mark2Count;       /* number of Mark2Record tables */
409   HB_Mark2Record*  Mark2Record;      /* array of Mark2Record tables  */
410 };
411
412 typedef struct HB_Mark2Array_  HB_Mark2Array;
413
414
415 struct  HB_MarkMarkPos_
416 {
417   HB_UShort       PosFormat;          /* always 1                         */
418   HB_Coverage    Mark1Coverage;      /* first mark glyph coverage table  */
419   HB_Coverage    Mark2Coverage;      /* second mark glyph coverave table */
420   HB_UShort       ClassCount;         /* number of combining mark classes */
421   HB_MarkArray   Mark1Array;         /* MarkArray table for first mark   */
422   HB_Mark2Array  Mark2Array;         /* MarkArray table for second mark  */
423 };
424
425 typedef struct HB_MarkMarkPos_  HB_MarkMarkPos;
426
427
428 /* needed by both lookup type 7 and 8 */
429
430 struct  HB_PosLookupRecord_
431 {
432   HB_UShort  SequenceIndex;           /* index into current
433                                          glyph sequence               */
434   HB_UShort  LookupListIndex;         /* Lookup to apply to that pos. */
435 };
436
437 typedef struct HB_PosLookupRecord_  HB_PosLookupRecord;
438
439
440 /* LookupType 7 */
441
442 struct  HB_PosRule_
443 {
444   HB_UShort             GlyphCount;   /* total number of input glyphs     */
445   HB_UShort             PosCount;     /* number of PosLookupRecord tables */
446   HB_UShort*            Input;        /* array of input glyph IDs         */
447   HB_PosLookupRecord*  PosLookupRecord;
448                                       /* array of PosLookupRecord tables  */
449 };
450
451 typedef struct HB_PosRule_  HB_PosRule;
452
453
454 struct  HB_PosRuleSet_
455 {
456   HB_UShort     PosRuleCount;         /* number of PosRule tables */
457   HB_PosRule*  PosRule;              /* array of PosRule tables  */
458 };
459
460 typedef struct HB_PosRuleSet_  HB_PosRuleSet;
461
462
463 struct  HB_ContextPosFormat1_
464 {
465   HB_Coverage     Coverage;          /* Coverage table              */
466   HB_UShort        PosRuleSetCount;   /* number of PosRuleSet tables */
467   HB_PosRuleSet*  PosRuleSet;        /* array of PosRuleSet tables  */
468 };
469
470 typedef struct HB_ContextPosFormat1_  HB_ContextPosFormat1;
471
472
473 struct  HB_PosClassRule_
474 {
475   HB_UShort             GlyphCount;   /* total number of context classes  */
476   HB_UShort             PosCount;     /* number of PosLookupRecord tables */
477   HB_UShort*            Class;        /* array of classes                 */
478   HB_PosLookupRecord*  PosLookupRecord;
479                                       /* array of PosLookupRecord tables  */
480 };
481
482 typedef struct HB_PosClassRule_  HB_PosClassRule;
483
484
485 struct  HB_PosClassSet_
486 {
487   HB_UShort          PosClassRuleCount;
488                                       /* number of PosClassRule tables */
489   HB_PosClassRule*  PosClassRule;    /* array of PosClassRule tables  */
490 };
491
492 typedef struct HB_PosClassSet_  HB_PosClassSet;
493
494
495 /* The `MaxContextLength' field is not defined in the TTO specification
496    but simplifies the implementation of this format.  It holds the
497    maximal context length used in the context rules.                    */
498
499 struct  HB_ContextPosFormat2_
500 {
501   HB_UShort            MaxContextLength;
502                                       /* maximal context length       */
503   HB_Coverage         Coverage;      /* Coverage table               */
504   HB_ClassDefinition  ClassDef;      /* ClassDef table               */
505   HB_UShort            PosClassSetCount;
506                                       /* number of PosClassSet tables */
507   HB_PosClassSet*     PosClassSet;   /* array of PosClassSet tables  */
508 };
509
510 typedef struct HB_ContextPosFormat2_  HB_ContextPosFormat2;
511
512
513 struct  HB_ContextPosFormat3_
514 {
515   HB_UShort             GlyphCount;   /* number of input glyphs           */
516   HB_UShort             PosCount;     /* number of PosLookupRecord tables */
517   HB_Coverage*         Coverage;     /* array of Coverage tables         */
518   HB_PosLookupRecord*  PosLookupRecord;
519                                       /* array of PosLookupRecord tables  */
520 };
521
522 typedef struct HB_ContextPosFormat3_  HB_ContextPosFormat3;
523
524
525 struct  HB_ContextPos_
526 {
527   HB_Byte  PosFormat;                 /* 1, 2, or 3     */
528
529   union
530   {
531     HB_ContextPosFormat1  cpf1;
532     HB_ContextPosFormat2  cpf2;
533     HB_ContextPosFormat3  cpf3;
534   } cpf;
535 };
536
537 typedef struct HB_ContextPos_  HB_ContextPos;
538
539
540 /* LookupType 8 */
541
542 struct  HB_ChainPosRule_
543 {
544   HB_UShort*            Backtrack;    /* array of backtrack glyph IDs     */
545   HB_UShort*            Input;        /* array of input glyph IDs         */
546   HB_UShort*            Lookahead;    /* array of lookahead glyph IDs     */
547   HB_PosLookupRecord*  PosLookupRecord;
548                                       /* array of PosLookupRecords       */
549   HB_UShort             BacktrackGlyphCount;
550                                       /* total number of backtrack glyphs */
551   HB_UShort             InputGlyphCount;
552                                       /* total number of input glyphs     */
553   HB_UShort             LookaheadGlyphCount;
554                                       /* total number of lookahead glyphs */
555   HB_UShort             PosCount;     /* number of PosLookupRecords       */
556 };
557
558 typedef struct HB_ChainPosRule_  HB_ChainPosRule;
559
560
561 struct  HB_ChainPosRuleSet_
562 {
563   HB_UShort          ChainPosRuleCount;
564                                       /* number of ChainPosRule tables */
565   HB_ChainPosRule*  ChainPosRule;    /* array of ChainPosRule tables  */
566 };
567
568 typedef struct HB_ChainPosRuleSet_  HB_ChainPosRuleSet;
569
570
571 struct  HB_ChainContextPosFormat1_
572 {
573   HB_Coverage          Coverage;     /* Coverage table                   */
574   HB_UShort             ChainPosRuleSetCount;
575                                       /* number of ChainPosRuleSet tables */
576   HB_ChainPosRuleSet*  ChainPosRuleSet;
577                                       /* array of ChainPosRuleSet tables  */
578 };
579
580 typedef struct HB_ChainContextPosFormat1_  HB_ChainContextPosFormat1;
581
582
583 struct  HB_ChainPosClassRule_
584 {
585   HB_UShort*            Backtrack;    /* array of backtrack classes      */
586   HB_UShort*            Input;        /* array of context classes        */
587   HB_UShort*            Lookahead;    /* array of lookahead classes      */
588   HB_PosLookupRecord*  PosLookupRecord;
589                                       /* array of substitution lookups   */
590   HB_UShort             BacktrackGlyphCount;
591                                       /* total number of backtrack
592                                          classes                         */
593   HB_UShort             InputGlyphCount;
594                                       /* total number of context classes */
595   HB_UShort             LookaheadGlyphCount;
596                                       /* total number of lookahead
597                                          classes                         */
598   HB_UShort             PosCount;     /* number of PosLookupRecords      */
599 };
600
601 typedef struct HB_ChainPosClassRule_  HB_ChainPosClassRule;
602
603
604 struct  HB_ChainPosClassSet_
605 {
606   HB_UShort               ChainPosClassRuleCount;
607                                       /* number of ChainPosClassRule
608                                          tables                      */
609   HB_ChainPosClassRule*  ChainPosClassRule;
610                                       /* array of ChainPosClassRule
611                                          tables                      */
612 };
613
614 typedef struct HB_ChainPosClassSet_  HB_ChainPosClassSet;
615
616
617 /* The `MaxXXXLength' fields are not defined in the TTO specification
618    but simplifies the implementation of this format.  It holds the
619    maximal context length used in the specific context rules.         */
620
621 struct  HB_ChainContextPosFormat2_
622 {
623   HB_Coverage           Coverage;    /* Coverage table             */
624
625   HB_UShort              MaxBacktrackLength;
626                                       /* maximal backtrack length   */
627   HB_ClassDefinition    BacktrackClassDef;
628                                       /* BacktrackClassDef table    */
629   HB_UShort              MaxInputLength;
630                                       /* maximal input length       */
631   HB_ClassDefinition    InputClassDef;
632                                       /* InputClassDef table        */
633   HB_UShort              MaxLookaheadLength;
634                                       /* maximal lookahead length   */
635   HB_ClassDefinition    LookaheadClassDef;
636                                       /* LookaheadClassDef table    */
637
638   HB_UShort              ChainPosClassSetCount;
639                                       /* number of ChainPosClassSet
640                                          tables                     */
641   HB_ChainPosClassSet*  ChainPosClassSet;
642                                       /* array of ChainPosClassSet
643                                          tables                     */
644 };
645
646 typedef struct HB_ChainContextPosFormat2_  HB_ChainContextPosFormat2;
647
648
649 struct  HB_ChainContextPosFormat3_
650 {
651   HB_UShort             BacktrackGlyphCount;
652                                       /* number of backtrack glyphs    */
653   HB_Coverage*         BacktrackCoverage;
654                                       /* array of backtrack Coverage
655                                          tables                        */
656   HB_UShort             InputGlyphCount;
657                                       /* number of input glyphs        */
658   HB_Coverage*         InputCoverage;
659                                       /* array of input coverage
660                                          tables                        */
661   HB_UShort             LookaheadGlyphCount;
662                                       /* number of lookahead glyphs    */
663   HB_Coverage*         LookaheadCoverage;
664                                       /* array of lookahead coverage
665                                          tables                        */
666   HB_UShort             PosCount;     /* number of PosLookupRecords    */
667   HB_PosLookupRecord*  PosLookupRecord;
668                                       /* array of substitution lookups */
669 };
670
671 typedef struct HB_ChainContextPosFormat3_  HB_ChainContextPosFormat3;
672
673
674 struct  HB_ChainContextPos_
675 {
676   HB_Byte  PosFormat;               /* 1, 2, or 3 */
677
678   union
679   {
680     HB_ChainContextPosFormat1  ccpf1;
681     HB_ChainContextPosFormat2  ccpf2;
682     HB_ChainContextPosFormat3  ccpf3;
683   } ccpf;
684 };
685
686 typedef struct HB_ChainContextPos_  HB_ChainContextPos;
687
688
689 #if 0
690 /* LookupType 10 */
691 struct HB_ExtensionPos_
692 {
693   HB_UShort      PosFormat;           /* always 1 */
694   HB_UShort      LookuptType;         /* lookup-type of referenced subtable */
695   HB_GPOS_SubTable *subtable;         /* referenced subtable */
696 };
697
698 typedef struct HB_ExtensionPos_  HB_ExtensionPos;
699 #endif
700
701
702 union  HB_GPOS_SubTable_
703 {
704   HB_SinglePos        single;
705   HB_PairPos          pair;
706   HB_CursivePos       cursive;
707   HB_MarkBasePos      markbase;
708   HB_MarkLigPos       marklig;
709   HB_MarkMarkPos      markmark;
710   HB_ContextPos       context;
711   HB_ChainContextPos  chain;
712 };
713
714 typedef union HB_GPOS_SubTable_  HB_GPOS_SubTable;
715
716
717
718 HB_INTERNAL HB_Error
719 _HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st,
720                                   HB_Stream     stream,
721                                   HB_UShort     lookup_type );
722
723 HB_INTERNAL void
724 _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
725                               HB_UShort     lookup_type );
726
727 HB_END_HEADER
728
729 #endif /* HARFBUZZ_GPOS_PRIVATE_H */