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