harfbuzz-gpos-private.h 20.6 KB
Newer Older
1 2 3
/*
 * Copyright (C) 1998-2004  David Turner and Werner Lemberg
 * Copyright (C) 2006  Behdad Esfahbod
4 5 6
 *
 *  This is part of HarfBuzz, an OpenType Layout engine library.
 *
7 8 9 10 11
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
12
 *
13 14 15 16 17 18 19 20 21 22 23 24 25
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

26 27 28
#ifndef HARFBUZZ_GPOS_PRIVATE_H
#define HARFBUZZ_GPOS_PRIVATE_H

29
#include "harfbuzz-impl.h"
B
Behdad Esfahbod 已提交
30
#include "harfbuzz-stream-private.h"
31 32
#include "harfbuzz-gpos.h"

33
HB_BEGIN_HEADER
34 35 36 37 38 39


/* shared tables */

struct  HB_ValueRecord_
{
40
  HB_Short    XPlacement;             /* horizontal adjustment for
41
					 placement                      */
42
  HB_Short    YPlacement;             /* vertical adjustment for
43
					 placement                      */
44
  HB_Short    XAdvance;               /* horizontal adjustment for
45
					 advance                        */
46
  HB_Short    YAdvance;               /* vertical adjustment for
47 48 49 50 51 52 53 54 55
					 advance                        */
  HB_Device  XPlacementDevice;       /* device table for horizontal
					 placement                      */
  HB_Device  YPlacementDevice;       /* device table for vertical
					 placement                      */
  HB_Device  XAdvanceDevice;         /* device table for horizontal
					 advance                        */
  HB_Device  YAdvanceDevice;         /* device table for vertical
					 advance                        */
56 57 58 59
  HB_UShort   XIdPlacement;           /* horizontal placement metric ID */
  HB_UShort   YIdPlacement;           /* vertical placement metric ID   */
  HB_UShort   XIdAdvance;             /* horizontal advance metric ID   */
  HB_UShort   YIdAdvance;             /* vertical advance metric ID     */
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
};

typedef struct HB_ValueRecord_  HB_ValueRecord;


/* Mask values to scan the value format of the ValueRecord structure.
 We always expand compressed ValueRecords of the font.              */

#define HB_GPOS_FORMAT_HAVE_X_PLACEMENT         0x0001
#define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT         0x0002
#define HB_GPOS_FORMAT_HAVE_X_ADVANCE           0x0004
#define HB_GPOS_FORMAT_HAVE_Y_ADVANCE           0x0008
#define HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE  0x0010
#define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE  0x0020
#define HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE    0x0040
#define HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE    0x0080
#define HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT      0x0100
#define HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT      0x0200
#define HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE        0x0400
#define HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE        0x0800


struct  HB_AnchorFormat1_
{
84 85
  HB_Short   XCoordinate;             /* horizontal value */
  HB_Short   YCoordinate;             /* vertical value   */
86 87 88 89 90 91 92
};

typedef struct HB_AnchorFormat1_  HB_AnchorFormat1;


struct  HB_AnchorFormat2_
{
93 94 95
  HB_Short   XCoordinate;             /* horizontal value             */
  HB_Short   YCoordinate;             /* vertical value               */
  HB_UShort  AnchorPoint;             /* index to glyph contour point */
96 97 98 99 100 101 102
};

typedef struct HB_AnchorFormat2_  HB_AnchorFormat2;


struct  HB_AnchorFormat3_
{
103 104
  HB_Short    XCoordinate;            /* horizontal value              */
  HB_Short    YCoordinate;            /* vertical value                */
105 106 107 108 109 110 111 112 113
  HB_Device  XDeviceTable;           /* device table for X coordinate */
  HB_Device  YDeviceTable;           /* device table for Y coordinate */
};

typedef struct HB_AnchorFormat3_  HB_AnchorFormat3;


struct  HB_AnchorFormat4_
{
114 115
  HB_UShort  XIdAnchor;               /* horizontal metric ID */
  HB_UShort  YIdAnchor;               /* vertical metric ID   */
116 117 118 119 120 121 122
};

typedef struct HB_AnchorFormat4_  HB_AnchorFormat4;


struct  HB_Anchor_
{
123
  HB_UShort  PosFormat;               /* 1, 2, 3, or 4 -- 0 indicates
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
					 that there is no Anchor table */

  union
  {
    HB_AnchorFormat1  af1;
    HB_AnchorFormat2  af2;
    HB_AnchorFormat3  af3;
    HB_AnchorFormat4  af4;
  } af;
};

typedef struct HB_Anchor_  HB_Anchor;


struct  HB_MarkRecord_
{
140
  HB_UShort   Class;                  /* mark class   */
141 142 143 144 145 146 147 148
  HB_Anchor  MarkAnchor;             /* anchor table */
};

typedef struct HB_MarkRecord_  HB_MarkRecord;


struct  HB_MarkArray_
{
149
  HB_UShort        MarkCount;         /* number of MarkRecord tables */
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
  HB_MarkRecord*  MarkRecord;        /* array of MarkRecord tables  */
};

typedef struct HB_MarkArray_  HB_MarkArray;


/* LookupType 1 */

struct  HB_SinglePosFormat1_
{
  HB_ValueRecord  Value;             /* ValueRecord for all covered
					 glyphs                      */
};

typedef struct HB_SinglePosFormat1_  HB_SinglePosFormat1;


struct  HB_SinglePosFormat2_
{
169
  HB_UShort         ValueCount;       /* number of ValueRecord tables */
170 171 172 173 174 175 176 177
  HB_ValueRecord*  Value;            /* array of ValueRecord tables  */
};

typedef struct HB_SinglePosFormat2_  HB_SinglePosFormat2;


struct  HB_SinglePos_
{
178
  HB_UShort     PosFormat;            /* 1 or 2         */
179 180
  HB_Coverage  Coverage;             /* Coverage table */

181
  HB_UShort     ValueFormat;          /* format of ValueRecord table */
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196

  union
  {
    HB_SinglePosFormat1  spf1;
    HB_SinglePosFormat2  spf2;
  } spf;
};

typedef struct HB_SinglePos_  HB_SinglePos;


/* LookupType 2 */

struct  HB_PairValueRecord_
{
197
  HB_UShort        SecondGlyph;       /* glyph ID for second glyph  */
198 199 200 201 202 203 204 205 206
  HB_ValueRecord  Value1;            /* pos. data for first glyph  */
  HB_ValueRecord  Value2;            /* pos. data for second glyph */
};

typedef struct HB_PairValueRecord_  HB_PairValueRecord;


struct  HB_PairSet_
{
207
  HB_UShort             PairValueCount;
208 209 210 211 212 213 214 215 216 217
				      /* number of PairValueRecord tables */
  HB_PairValueRecord*  PairValueRecord;
				      /* array of PairValueRecord tables  */
};

typedef struct HB_PairSet_  HB_PairSet;


struct  HB_PairPosFormat1_
{
218
  HB_UShort     PairSetCount;         /* number of PairSet tables    */
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
  HB_PairSet*  PairSet;              /* array of PairSet tables     */
};

typedef struct HB_PairPosFormat1_  HB_PairPosFormat1;


struct  HB_Class2Record_
{
  HB_ValueRecord  Value1;            /* pos. data for first glyph  */
  HB_ValueRecord  Value2;            /* pos. data for second glyph */
};

typedef struct HB_Class2Record_  HB_Class2Record;


struct  HB_Class1Record_
{
  HB_Class2Record*  Class2Record;    /* array of Class2Record tables */
};

typedef struct HB_Class1Record_  HB_Class1Record;


struct  HB_PairPosFormat2_
{
  HB_ClassDefinition  ClassDef1;     /* class def. for first glyph     */
  HB_ClassDefinition  ClassDef2;     /* class def. for second glyph    */
246
  HB_UShort            Class1Count;   /* number of classes in ClassDef1
247
					 table                          */
248
  HB_UShort            Class2Count;   /* number of classes in ClassDef2
249 250 251 252 253 254 255 256 257
					 table                          */
  HB_Class1Record*    Class1Record;  /* array of Class1Record tables   */
};

typedef struct HB_PairPosFormat2_  HB_PairPosFormat2;


struct  HB_PairPos_
{
258
  HB_UShort     PosFormat;            /* 1 or 2         */
259
  HB_Coverage  Coverage;             /* Coverage table */
260
  HB_UShort     ValueFormat1;         /* format of ValueRecord table
261
					 for first glyph             */
262
  HB_UShort     ValueFormat2;         /* format of ValueRecord table
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
					 for second glyph            */

  union
  {
    HB_PairPosFormat1  ppf1;
    HB_PairPosFormat2  ppf2;
  } ppf;
};

typedef struct HB_PairPos_  HB_PairPos;


/* LookupType 3 */

struct  HB_EntryExitRecord_
{
  HB_Anchor  EntryAnchor;            /* entry Anchor table */
  HB_Anchor  ExitAnchor;             /* exit Anchor table  */
};


typedef struct HB_EntryExitRecord_  HB_EntryExitRecord;

struct  HB_CursivePos_
{
288
  HB_UShort             PosFormat;    /* always 1                         */
289
  HB_Coverage          Coverage;     /* Coverage table                   */
290
  HB_UShort             EntryExitCount;
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
				      /* number of EntryExitRecord tables */
  HB_EntryExitRecord*  EntryExitRecord;
				      /* array of EntryExitRecord tables  */
};

typedef struct HB_CursivePos_  HB_CursivePos;


/* LookupType 4 */

struct  HB_BaseRecord_
{
  HB_Anchor*  BaseAnchor;            /* array of base glyph anchor
					 tables                     */
};

typedef struct HB_BaseRecord_  HB_BaseRecord;


struct  HB_BaseArray_
{
312
  HB_UShort        BaseCount;         /* number of BaseRecord tables */
313 314 315 316 317 318 319 320
  HB_BaseRecord*  BaseRecord;        /* array of BaseRecord tables  */
};

typedef struct HB_BaseArray_  HB_BaseArray;


struct  HB_MarkBasePos_
{
321
  HB_UShort      PosFormat;           /* always 1                  */
322 323
  HB_Coverage   MarkCoverage;        /* mark glyph coverage table */
  HB_Coverage   BaseCoverage;        /* base glyph coverage table */
324
  HB_UShort      ClassCount;          /* number of mark classes    */
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
  HB_MarkArray  MarkArray;           /* mark array table          */
  HB_BaseArray  BaseArray;           /* base array table          */
};

typedef struct HB_MarkBasePos_  HB_MarkBasePos;


/* LookupType 5 */

struct  HB_ComponentRecord_
{
  HB_Anchor*  LigatureAnchor;        /* array of ligature glyph anchor
					 tables                         */
};

typedef struct HB_ComponentRecord_  HB_ComponentRecord;


struct  HB_LigatureAttach_
{
345
  HB_UShort             ComponentCount;
346 347 348 349 350 351 352 353 354 355
				      /* number of ComponentRecord tables */
  HB_ComponentRecord*  ComponentRecord;
				      /* array of ComponentRecord tables  */
};

typedef struct HB_LigatureAttach_  HB_LigatureAttach;


struct  HB_LigatureArray_
{
356
  HB_UShort            LigatureCount; /* number of LigatureAttach tables */
357 358 359 360 361 362 363 364 365
  HB_LigatureAttach*  LigatureAttach;
				      /* array of LigatureAttach tables  */
};

typedef struct HB_LigatureArray_  HB_LigatureArray;


struct  HB_MarkLigPos_
{
366
  HB_UShort          PosFormat;       /* always 1                      */
367 368 369
  HB_Coverage       MarkCoverage;    /* mark glyph coverage table     */
  HB_Coverage       LigatureCoverage;
				      /* ligature glyph coverage table */
370
  HB_UShort          ClassCount;      /* number of mark classes        */
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
  HB_MarkArray      MarkArray;       /* mark array table              */
  HB_LigatureArray  LigatureArray;   /* ligature array table          */
};

typedef struct HB_MarkLigPos_  HB_MarkLigPos;


/* LookupType 6 */

struct  HB_Mark2Record_
{
  HB_Anchor*  Mark2Anchor;           /* array of mark glyph anchor
					 tables                     */
};

typedef struct HB_Mark2Record_  HB_Mark2Record;


struct  HB_Mark2Array_
{
391
  HB_UShort         Mark2Count;       /* number of Mark2Record tables */
392 393 394 395 396 397 398 399
  HB_Mark2Record*  Mark2Record;      /* array of Mark2Record tables  */
};

typedef struct HB_Mark2Array_  HB_Mark2Array;


struct  HB_MarkMarkPos_
{
400
  HB_UShort       PosFormat;          /* always 1                         */
401 402
  HB_Coverage    Mark1Coverage;      /* first mark glyph coverage table  */
  HB_Coverage    Mark2Coverage;      /* second mark glyph coverave table */
403
  HB_UShort       ClassCount;         /* number of combining mark classes */
404 405 406 407 408 409 410 411 412 413 414
  HB_MarkArray   Mark1Array;         /* MarkArray table for first mark   */
  HB_Mark2Array  Mark2Array;         /* MarkArray table for second mark  */
};

typedef struct HB_MarkMarkPos_  HB_MarkMarkPos;


/* needed by both lookup type 7 and 8 */

struct  HB_PosLookupRecord_
{
415
  HB_UShort  SequenceIndex;           /* index into current
416
					 glyph sequence               */
417
  HB_UShort  LookupListIndex;         /* Lookup to apply to that pos. */
418 419 420 421 422 423 424 425 426
};

typedef struct HB_PosLookupRecord_  HB_PosLookupRecord;


/* LookupType 7 */

struct  HB_PosRule_
{
427 428 429
  HB_UShort             GlyphCount;   /* total number of input glyphs     */
  HB_UShort             PosCount;     /* number of PosLookupRecord tables */
  HB_UShort*            Input;        /* array of input glyph IDs         */
430 431 432 433 434 435 436 437 438
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of PosLookupRecord tables  */
};

typedef struct HB_PosRule_  HB_PosRule;


struct  HB_PosRuleSet_
{
439
  HB_UShort     PosRuleCount;         /* number of PosRule tables */
440 441 442 443 444 445 446 447 448
  HB_PosRule*  PosRule;              /* array of PosRule tables  */
};

typedef struct HB_PosRuleSet_  HB_PosRuleSet;


struct  HB_ContextPosFormat1_
{
  HB_Coverage     Coverage;          /* Coverage table              */
449
  HB_UShort        PosRuleSetCount;   /* number of PosRuleSet tables */
450 451 452 453 454 455 456 457
  HB_PosRuleSet*  PosRuleSet;        /* array of PosRuleSet tables  */
};

typedef struct HB_ContextPosFormat1_  HB_ContextPosFormat1;


struct  HB_PosClassRule_
{
458 459 460
  HB_UShort             GlyphCount;   /* total number of context classes  */
  HB_UShort             PosCount;     /* number of PosLookupRecord tables */
  HB_UShort*            Class;        /* array of classes                 */
461 462 463 464 465 466 467 468 469
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of PosLookupRecord tables  */
};

typedef struct HB_PosClassRule_  HB_PosClassRule;


struct  HB_PosClassSet_
{
470
  HB_UShort          PosClassRuleCount;
471 472 473 474 475 476 477 478 479 480 481 482 483
				      /* number of PosClassRule tables */
  HB_PosClassRule*  PosClassRule;    /* array of PosClassRule tables  */
};

typedef struct HB_PosClassSet_  HB_PosClassSet;


/* The `MaxContextLength' field is not defined in the TTO specification
   but simplifies the implementation of this format.  It holds the
   maximal context length used in the context rules.                    */

struct  HB_ContextPosFormat2_
{
484
  HB_UShort            MaxContextLength;
485 486 487
				      /* maximal context length       */
  HB_Coverage         Coverage;      /* Coverage table               */
  HB_ClassDefinition  ClassDef;      /* ClassDef table               */
488
  HB_UShort            PosClassSetCount;
489 490 491 492 493 494 495 496 497
				      /* number of PosClassSet tables */
  HB_PosClassSet*     PosClassSet;   /* array of PosClassSet tables  */
};

typedef struct HB_ContextPosFormat2_  HB_ContextPosFormat2;


struct  HB_ContextPosFormat3_
{
498 499
  HB_UShort             GlyphCount;   /* number of input glyphs           */
  HB_UShort             PosCount;     /* number of PosLookupRecord tables */
500 501 502 503 504 505 506 507 508 509
  HB_Coverage*         Coverage;     /* array of Coverage tables         */
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of PosLookupRecord tables  */
};

typedef struct HB_ContextPosFormat3_  HB_ContextPosFormat3;


struct  HB_ContextPos_
{
510
  HB_UShort  PosFormat;               /* 1, 2, or 3     */
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526

  union
  {
    HB_ContextPosFormat1  cpf1;
    HB_ContextPosFormat2  cpf2;
    HB_ContextPosFormat3  cpf3;
  } cpf;
};

typedef struct HB_ContextPos_  HB_ContextPos;


/* LookupType 8 */

struct  HB_ChainPosRule_
{
527
  HB_UShort             BacktrackGlyphCount;
528
				      /* total number of backtrack glyphs */
529 530
  HB_UShort*            Backtrack;    /* array of backtrack glyph IDs     */
  HB_UShort             InputGlyphCount;
531
				      /* total number of input glyphs     */
532 533
  HB_UShort*            Input;        /* array of input glyph IDs         */
  HB_UShort             LookaheadGlyphCount;
534
				      /* total number of lookahead glyphs */
535 536
  HB_UShort*            Lookahead;    /* array of lookahead glyph IDs     */
  HB_UShort             PosCount;     /* number of PosLookupRecords       */
537 538 539 540 541 542 543 544 545
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of PosLookupRecords       */
};

typedef struct HB_ChainPosRule_  HB_ChainPosRule;


struct  HB_ChainPosRuleSet_
{
546
  HB_UShort          ChainPosRuleCount;
547 548 549 550 551 552 553 554 555 556
				      /* number of ChainPosRule tables */
  HB_ChainPosRule*  ChainPosRule;    /* array of ChainPosRule tables  */
};

typedef struct HB_ChainPosRuleSet_  HB_ChainPosRuleSet;


struct  HB_ChainContextPosFormat1_
{
  HB_Coverage          Coverage;     /* Coverage table                   */
557
  HB_UShort             ChainPosRuleSetCount;
558 559 560 561 562 563 564 565 566 567
				      /* number of ChainPosRuleSet tables */
  HB_ChainPosRuleSet*  ChainPosRuleSet;
				      /* array of ChainPosRuleSet tables  */
};

typedef struct HB_ChainContextPosFormat1_  HB_ChainContextPosFormat1;


struct  HB_ChainPosClassRule_
{
568
  HB_UShort             BacktrackGlyphCount;
569 570
				      /* total number of backtrack
					 classes                         */
571 572
  HB_UShort*            Backtrack;    /* array of backtrack classes      */
  HB_UShort             InputGlyphCount;
573
				      /* total number of context classes */
574 575
  HB_UShort*            Input;        /* array of context classes        */
  HB_UShort             LookaheadGlyphCount;
576 577
				      /* total number of lookahead
					 classes                         */
578 579
  HB_UShort*            Lookahead;    /* array of lookahead classes      */
  HB_UShort             PosCount;     /* number of PosLookupRecords      */
580 581 582 583 584 585 586 587 588
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of substitution lookups   */
};

typedef struct HB_ChainPosClassRule_  HB_ChainPosClassRule;


struct  HB_ChainPosClassSet_
{
589
  HB_UShort               ChainPosClassRuleCount;
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
				      /* number of ChainPosClassRule
					 tables                      */
  HB_ChainPosClassRule*  ChainPosClassRule;
				      /* array of ChainPosClassRule
					 tables                      */
};

typedef struct HB_ChainPosClassSet_  HB_ChainPosClassSet;


/* The `MaxXXXLength' fields are not defined in the TTO specification
   but simplifies the implementation of this format.  It holds the
   maximal context length used in the specific context rules.         */

struct  HB_ChainContextPosFormat2_
{
  HB_Coverage           Coverage;    /* Coverage table             */

608
  HB_UShort              MaxBacktrackLength;
609 610 611
				      /* maximal backtrack length   */
  HB_ClassDefinition    BacktrackClassDef;
				      /* BacktrackClassDef table    */
612
  HB_UShort              MaxInputLength;
613 614 615
				      /* maximal input length       */
  HB_ClassDefinition    InputClassDef;
				      /* InputClassDef table        */
616
  HB_UShort              MaxLookaheadLength;
617 618 619 620
				      /* maximal lookahead length   */
  HB_ClassDefinition    LookaheadClassDef;
				      /* LookaheadClassDef table    */

621
  HB_UShort              ChainPosClassSetCount;
622 623 624 625 626 627 628 629 630 631 632 633
				      /* number of ChainPosClassSet
					 tables                     */
  HB_ChainPosClassSet*  ChainPosClassSet;
				      /* array of ChainPosClassSet
					 tables                     */
};

typedef struct HB_ChainContextPosFormat2_  HB_ChainContextPosFormat2;


struct  HB_ChainContextPosFormat3_
{
634
  HB_UShort             BacktrackGlyphCount;
635 636 637 638
				      /* number of backtrack glyphs    */
  HB_Coverage*         BacktrackCoverage;
				      /* array of backtrack Coverage
					 tables                        */
639
  HB_UShort             InputGlyphCount;
640 641 642 643
				      /* number of input glyphs        */
  HB_Coverage*         InputCoverage;
				      /* array of input coverage
					 tables                        */
644
  HB_UShort             LookaheadGlyphCount;
645 646 647 648
				      /* number of lookahead glyphs    */
  HB_Coverage*         LookaheadCoverage;
				      /* array of lookahead coverage
					 tables                        */
649
  HB_UShort             PosCount;     /* number of PosLookupRecords    */
650 651 652 653 654 655 656 657 658
  HB_PosLookupRecord*  PosLookupRecord;
				      /* array of substitution lookups */
};

typedef struct HB_ChainContextPosFormat3_  HB_ChainContextPosFormat3;


struct  HB_ChainContextPos_
{
659
  HB_UShort  PosFormat;             /* 1, 2, or 3 */
660 661 662 663 664 665 666 667 668 669 670 671

  union
  {
    HB_ChainContextPosFormat1  ccpf1;
    HB_ChainContextPosFormat2  ccpf2;
    HB_ChainContextPosFormat3  ccpf3;
  } ccpf;
};

typedef struct HB_ChainContextPos_  HB_ChainContextPos;


672 673 674 675
#if 0
/* LookupType 10 */
struct HB_ExtensionPos_
{
676 677
  HB_UShort      PosFormat;           /* always 1 */
  HB_UShort      LookuptType;         /* lookup-type of referenced subtable */
678 679 680 681 682 683 684
  HB_GPOS_SubTable *subtable;         /* referenced subtable */
};

typedef struct HB_ExtensionPos_  HB_ExtensionPos;
#endif


685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700
union  HB_GPOS_SubTable_
{
  HB_SinglePos        single;
  HB_PairPos          pair;
  HB_CursivePos       cursive;
  HB_MarkBasePos      markbase;
  HB_MarkLigPos       marklig;
  HB_MarkMarkPos      markmark;
  HB_ContextPos       context;
  HB_ChainContextPos  chain;
};

typedef union HB_GPOS_SubTable_  HB_GPOS_SubTable;



701 702
HB_INTERNAL HB_Error
_HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st,
703
			HB_Stream         stream,
704
			HB_UShort         lookup_type );
705

706 707
HB_INTERNAL void
_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
708
		        HB_UShort         lookup_type );
709

710
HB_END_HEADER
711 712

#endif /* HARFBUZZ_GPOS_PRIVATE_H */