| 1 |
/* gpos.h -- define data structures for Glyph Positioning Table |
| 2 |
*/ |
| 3 |
|
| 4 |
#ifndef __TTF_GPOS_H |
| 5 |
#define __TTF_GPOS_H |
| 6 |
|
| 7 |
/* ValueFormat Bits */ |
| 8 |
#define ValueFormat_XPlacement 0x0001 << 0 |
| 9 |
#define ValueFormat_YPlacement 0x0001 << 1 |
| 10 |
#define ValueFormat_XAdvance 0x0001 << 2 |
| 11 |
#define ValueFormat_YAdvance 0x0001 << 3 |
| 12 |
#define ValueFormat_AllDesign 0x000f |
| 13 |
#define ValueFormat_XPlaDevice 0x0010 << 0 |
| 14 |
#define ValueFormat_YPlaDevice 0x0010 << 1 |
| 15 |
#define ValueFormat_XAdvDevice 0x0010 << 2 |
| 16 |
#define ValueFormat_YAdvDevice 0x0010 << 3 |
| 17 |
#define ValueFormat_AllDevice 0x00f0 |
| 18 |
#define ValueFormat_Reserved 0xff00 |
| 19 |
|
| 20 |
/* Positioning LookupType Values */ |
| 21 |
#define PosLookup_SingleAdjustment 1 |
| 22 |
#define PosLookup_PairAdjustment 2 |
| 23 |
#define PosLookup_CursiveAttachment 3 |
| 24 |
#define PosLookup_MarkToBaseAttachment 4 |
| 25 |
#define PosLookup_MarkToLigatureAttachment 5 |
| 26 |
#define PosLookup_MarkToMarkAttachment 6 |
| 27 |
#define PosLookup_ContextPositioning 7 |
| 28 |
#define PosLookup_ChainedContextPositioning 8 |
| 29 |
#define PosLookup_ExtensionPositioning 9 |
| 30 |
#define PosLookup_Max 9 |
| 31 |
|
| 32 |
typedef struct |
| 33 |
{ |
| 34 |
SHORT valDesign[4]; |
| 35 |
union |
| 36 |
{ |
| 37 |
USHORT offset; |
| 38 |
DevicePtr device; |
| 39 |
} |
| 40 |
valDevice[4]; |
| 41 |
} |
| 42 |
ValueRecord, *ValueRecordPtr; |
| 43 |
|
| 44 |
typedef struct |
| 45 |
{ |
| 46 |
USHORT anchorFormat; /* = 1 */ |
| 47 |
SHORT xCoordinate; |
| 48 |
SHORT yCoordinate; |
| 49 |
} |
| 50 |
Anchor1, *Anchor1Ptr; |
| 51 |
|
| 52 |
typedef struct |
| 53 |
{ |
| 54 |
USHORT anchorFormat; /* = 2 */ |
| 55 |
SHORT xCoordinate; |
| 56 |
SHORT yCoordinate; |
| 57 |
USHORT anchorPoint; |
| 58 |
} |
| 59 |
Anchor2, *Anchor2Ptr; |
| 60 |
|
| 61 |
typedef struct |
| 62 |
{ |
| 63 |
USHORT anchorFormat; /* = 3 */ |
| 64 |
SHORT xCoordinate; |
| 65 |
SHORT yCoordinate; |
| 66 |
DevicePtr xDevice; |
| 67 |
DevicePtr yDevice; |
| 68 |
} |
| 69 |
Anchor3, *Anchor3Ptr; |
| 70 |
|
| 71 |
typedef union |
| 72 |
{ |
| 73 |
Anchor1Ptr anchor1; |
| 74 |
Anchor2Ptr anchor2; |
| 75 |
Anchor3Ptr anchor3; |
| 76 |
} |
| 77 |
AnchorPtr; |
| 78 |
|
| 79 |
typedef struct |
| 80 |
{ |
| 81 |
USHORT class; |
| 82 |
AnchorPtr markAnchor; |
| 83 |
} |
| 84 |
MarkRecord, *MarkRecordPtr; |
| 85 |
|
| 86 |
typedef struct |
| 87 |
{ |
| 88 |
USHORT lookupType; /* = 1 */ |
| 89 |
USHORT lookupFormat; /* = 1 */ |
| 90 |
CoveragePtr coverage; |
| 91 |
USHORT valueFormat; |
| 92 |
ValueRecordPtr value; |
| 93 |
} |
| 94 |
Pos11, *Pos11Ptr; |
| 95 |
|
| 96 |
typedef struct |
| 97 |
{ |
| 98 |
USHORT lookupType; /* = 1 */ |
| 99 |
USHORT lookupFormat; /* = 2 */ |
| 100 |
CoveragePtr coverage; |
| 101 |
USHORT valueFormat; |
| 102 |
USHORT valueCount; |
| 103 |
ValueRecordPtr *value; /* length = valueCount */ |
| 104 |
} |
| 105 |
Pos12, *Pos12Ptr; |
| 106 |
|
| 107 |
typedef struct |
| 108 |
{ |
| 109 |
USHORT secondGlyph; |
| 110 |
ValueRecordPtr value1; |
| 111 |
ValueRecordPtr value2; |
| 112 |
} |
| 113 |
PairValueRecord, *PairValueRecordPtr; |
| 114 |
|
| 115 |
typedef struct |
| 116 |
{ |
| 117 |
USHORT pairValueCount; |
| 118 |
PairValueRecordPtr pairValue; /* length = pairValueCount */ |
| 119 |
} |
| 120 |
PairSet, *PairSetPtr; |
| 121 |
|
| 122 |
typedef struct |
| 123 |
{ |
| 124 |
USHORT lookupType; /* = 2 */ |
| 125 |
USHORT lookupFormat; /* = 1 */ |
| 126 |
CoveragePtr coverage; |
| 127 |
USHORT valueFormat1; |
| 128 |
USHORT valueFormat2; |
| 129 |
USHORT pairSetCount; |
| 130 |
PairSetPtr pairSet; /* length = pairSetCount */ |
| 131 |
} |
| 132 |
Pos21, *Pos21Ptr; |
| 133 |
|
| 134 |
typedef struct |
| 135 |
{ |
| 136 |
USHORT lookupType; /* = 2 */ |
| 137 |
USHORT lookupFormat; /* = 2 */ |
| 138 |
CoveragePtr coverage; |
| 139 |
USHORT valueFormat1; |
| 140 |
USHORT valueFormat2; |
| 141 |
ClassDefPtr classDef1; |
| 142 |
ClassDefPtr classDef2; |
| 143 |
USHORT class1Count; |
| 144 |
USHORT class2Count; |
| 145 |
ValueRecordPtr *values; /* length = 2 * class1Count * class2Count */ |
| 146 |
} |
| 147 |
Pos22, *Pos22Ptr; |
| 148 |
|
| 149 |
typedef struct |
| 150 |
{ |
| 151 |
USHORT lookupType; /* = 3 */ |
| 152 |
USHORT lookupFormat; /* = 1 */ |
| 153 |
CoveragePtr coverage; |
| 154 |
USHORT entryExitCount; |
| 155 |
AnchorPtr *entryExit; /* length = 2 * entryExitCount */ |
| 156 |
} |
| 157 |
Pos31, *Pos31Ptr; |
| 158 |
|
| 159 |
typedef struct |
| 160 |
{ |
| 161 |
USHORT lookupType; /* = 4 */ |
| 162 |
USHORT lookupFormat; /* = 1 */ |
| 163 |
CoveragePtr markCoverage; |
| 164 |
CoveragePtr baseCoverage; |
| 165 |
USHORT markCount; |
| 166 |
USHORT baseCount; |
| 167 |
USHORT classCount; |
| 168 |
MarkRecordPtr markArray; /* length = markCount */ |
| 169 |
AnchorPtr *baseArray; /* length = baseCount * classCount */ |
| 170 |
} |
| 171 |
Pos41, *Pos41Ptr; |
| 172 |
|
| 173 |
typedef struct |
| 174 |
{ |
| 175 |
USHORT componentCount; |
| 176 |
AnchorPtr *componentRecord; /* length = componentCount * classCount */ |
| 177 |
} |
| 178 |
LigatureAttach, *LigatureAttachPtr; |
| 179 |
|
| 180 |
typedef struct |
| 181 |
{ |
| 182 |
USHORT lookupType; /* = 5 */ |
| 183 |
USHORT lookupFormat; /* = 1 */ |
| 184 |
CoveragePtr markCoverage; |
| 185 |
CoveragePtr ligatureCoverage; |
| 186 |
USHORT markCount; |
| 187 |
USHORT ligatureCount; |
| 188 |
USHORT classCount; |
| 189 |
MarkRecordPtr markArray; /* length = markCount */ |
| 190 |
LigatureAttachPtr ligatureArray; /* length = ligatureCount */ |
| 191 |
} |
| 192 |
Pos51, *Pos51Ptr; |
| 193 |
|
| 194 |
typedef struct |
| 195 |
{ |
| 196 |
USHORT lookupType; /* = 6 */ |
| 197 |
USHORT lookupFormat; /* = 1 */ |
| 198 |
CoveragePtr mark1Coverage; |
| 199 |
CoveragePtr mark2Coverage; |
| 200 |
USHORT mark1Count; |
| 201 |
USHORT mark2Count; |
| 202 |
USHORT classCount; |
| 203 |
MarkRecordPtr mark1Array; /* length = mark1Count */ |
| 204 |
AnchorPtr *mark2Array; /* length = mark2Count * classCount */ |
| 205 |
} |
| 206 |
Pos61, *Pos61Ptr; |
| 207 |
|
| 208 |
#define Pos71Ptr OtfCtx1Ptr |
| 209 |
#define Pos72Ptr OtfCtx2Ptr |
| 210 |
#define Pos73Ptr OtfCtx3Ptr |
| 211 |
#define Pos81Ptr OtfChn1Ptr |
| 212 |
#define Pos82Ptr OtfChn2Ptr |
| 213 |
#define Pos83Ptr OtfChn3Ptr |
| 214 |
|
| 215 |
typedef union |
| 216 |
{ |
| 217 |
Pos11Ptr pos11; |
| 218 |
Pos12Ptr pos12; |
| 219 |
Pos21Ptr pos21; |
| 220 |
Pos22Ptr pos22; |
| 221 |
Pos31Ptr pos31; |
| 222 |
Pos41Ptr pos41; |
| 223 |
Pos51Ptr pos51; |
| 224 |
Pos61Ptr pos61; |
| 225 |
Pos71Ptr pos71; |
| 226 |
Pos72Ptr pos72; |
| 227 |
Pos73Ptr pos73; |
| 228 |
Pos81Ptr pos81; |
| 229 |
Pos82Ptr pos82; |
| 230 |
Pos83Ptr pos83; |
| 231 |
} |
| 232 |
PosLookupPtr; |
| 233 |
|
| 234 |
#endif /* __TTF_GPOS_H */ |