1/*
2 *
3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
4 *
5 */
6
7#ifndef __PAIRPOSITIONINGSUBTABLES_H
8#define __PAIRPOSITIONINGSUBTABLES_H
9
10/**
11 * \file
12 * \internal
13 */
14
15#include "LETypes.h"
16#include "LEFontInstance.h"
17#include "OpenTypeTables.h"
18#include "GlyphPositioningTables.h"
19#include "ValueRecords.h"
20#include "GlyphIterator.h"
21
22U_NAMESPACE_BEGIN
23
24// NOTE: ValueRecord has a variable size
25struct PairValueRecord
26{
27    TTGlyphID     secondGlyph;
28    ValueRecord valueRecord1;
29//  ValueRecord valueRecord2;
30};
31
32struct PairSetTable
33{
34    le_uint16       pairValueCount;
35    PairValueRecord pairValueRecordArray[ANY_NUMBER];
36};
37LE_VAR_ARRAY(PairSetTable, pairValueRecordArray)
38
39struct PairPositioningSubtable : GlyphPositioningSubtable
40{
41    ValueFormat valueFormat1;
42    ValueFormat valueFormat2;
43
44    le_uint32  process(const LEReferenceTo<PairPositioningSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const;
45};
46
47struct PairPositioningFormat1Subtable : PairPositioningSubtable
48{
49    le_uint16   pairSetCount;
50    Offset      pairSetTableOffsetArray[ANY_NUMBER];
51
52    le_uint32  process(const LEReferenceTo<PairPositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const;
53
54private:
55    const PairValueRecord *findPairValueRecord(TTGlyphID glyphID, const PairValueRecord *records,
56        le_uint16 recordCount, le_uint16 recordSize) const;
57};
58LE_VAR_ARRAY(PairPositioningFormat1Subtable, pairSetTableOffsetArray)
59
60// NOTE: ValueRecord has a variable size
61struct Class2Record
62{
63    ValueRecord valueRecord1;
64//  ValueRecord valurRecord2;
65};
66
67struct Class1Record
68{
69    Class2Record class2RecordArray[ANY_NUMBER];
70};
71LE_VAR_ARRAY(Class1Record, class2RecordArray)
72
73struct PairPositioningFormat2Subtable : PairPositioningSubtable
74{
75    Offset       classDef1Offset;
76    Offset       classDef2Offset;
77    le_uint16    class1Count;
78    le_uint16    class2Count;
79    Class1Record class1RecordArray[ANY_NUMBER];
80
81    le_uint32  process(const LEReferenceTo<PairPositioningFormat2Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const;
82};
83LE_VAR_ARRAY(PairPositioningFormat2Subtable, class1RecordArray)
84
85U_NAMESPACE_END
86#endif
87
88
89