3 * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
7 #ifndef __MORPHTABLES_H
8 #define __MORPHTABLES_H
16 #include "LayoutTables.h"
17 #include "LETableReference.h"
23 typedef le_uint32 FeatureFlags
;
25 typedef le_int16 FeatureType
;
26 typedef le_int16 FeatureSetting
;
28 struct FeatureTableEntry
30 FeatureType featureType
;
31 FeatureSetting featureSetting
;
32 FeatureFlags enableFlags
;
33 FeatureFlags disableFlags
;
38 FeatureFlags defaultFlags
;
39 le_uint32 chainLength
;
40 le_int16 nFeatureEntries
;
42 FeatureTableEntry featureTable
[ANY_NUMBER
];
44 LE_VAR_ARRAY(ChainHeader
, featureTable
)
46 struct MorphTableHeader
50 ChainHeader chains
[ANY_NUMBER
];
52 void process(const LETableReference
& base
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
) const;
54 LE_VAR_ARRAY(MorphTableHeader
, chains
)
56 typedef le_int16 SubtableCoverage
;
57 typedef le_uint32 SubtableCoverage2
;
59 enum SubtableCoverageFlags
68 enum MorphSubtableType
70 mstIndicRearrangement
= 0,
71 mstContextualGlyphSubstitution
= 1,
72 mstLigatureSubstitution
= 2,
73 mstReservedUnused
= 3,
74 mstNonContextualGlyphSubstitution
= 4,
75 mstContextualGlyphInsertion
= 5
78 struct MorphSubtableHeader
81 SubtableCoverage coverage
;
82 FeatureFlags subtableFeatures
;
84 void process(const LEReferenceTo
<MorphSubtableHeader
> &base
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
) const;
87 enum SubtableCoverageFlags2
89 scfVertical2
= 0x80000000,
90 scfReverse2
= 0x40000000,
91 scfIgnoreVt2
= 0x20000000,
92 scfReserved2
= 0x1FFFFF00,
93 scfTypeMask2
= 0x000000FF
96 struct MorphSubtableHeader2
99 SubtableCoverage2 coverage
;
100 FeatureFlags subtableFeatures
;
102 void process(const LEReferenceTo
<MorphSubtableHeader2
> &base
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
) const;
107 FeatureFlags defaultFlags
;
108 le_uint32 chainLength
;
109 le_uint32 nFeatureEntries
;
110 le_uint32 nSubtables
;
111 FeatureTableEntry featureTable
[ANY_NUMBER
];
113 LE_VAR_ARRAY(ChainHeader2
, featureTable
)
115 struct MorphTableHeader2
119 ChainHeader2 chains
[ANY_NUMBER
];
121 void process(const LEReferenceTo
<MorphTableHeader2
> &base
, LEGlyphStorage
&glyphStorage
, le_int32 typoFlags
, LEErrorCode
&success
) const;
123 LE_VAR_ARRAY(MorphTableHeader2
, chains
)
127 * source: https://developer.apple.com/fonts/registry/
128 * (plus addition from ATS/SFNTLayoutTypes.h)
133 allTypographicFeaturesType
= 0,
135 allTypeFeaturesOnSelector
= 0,
136 allTypeFeaturesOffSelector
= 1,
140 requiredLigaturesOnSelector
= 0,
141 requiredLigaturesOffSelector
= 1,
142 commonLigaturesOnSelector
= 2,
143 commonLigaturesOffSelector
= 3,
144 rareLigaturesOnSelector
= 4,
145 rareLigaturesOffSelector
= 5,
147 logosOffSelector
= 7,
148 rebusPicturesOnSelector
= 8,
149 rebusPicturesOffSelector
= 9,
150 diphthongLigaturesOnSelector
= 10,
151 diphthongLigaturesOffSelector
= 11,
152 squaredLigaturesOnSelector
= 12,
153 squaredLigaturesOffSelector
= 13,
154 abbrevSquaredLigaturesOnSelector
= 14,
155 abbrevSquaredLigaturesOffSelector
= 15,
156 symbolLigaturesOnSelector
= 16,
157 symbolLigaturesOffSelector
= 17,
158 contextualLigaturesOnSelector
= 18,
159 contextualLigaturesOffSelector
= 19,
160 historicalLigaturesOnSelector
= 20,
161 historicalLigaturesOffSelector
= 21,
163 cursiveConnectionType
= 2,
165 unconnectedSelector
= 0,
166 partiallyConnectedSelector
= 1,
171 upperAndLowerCaseSelector
= 0,
173 allLowerCaseSelector
= 2,
174 smallCapsSelector
= 3,
175 initialCapsSelector
= 4,
176 initialCapsAndSmallCapsSelector
= 5,
178 verticalSubstitutionType
= 4,
180 substituteVerticalFormsOnSelector
= 0,
181 substituteVerticalFormsOffSelector
= 1,
183 linguisticRearrangementType
= 5,
185 linguisticRearrangementOnSelector
= 0,
186 linguisticRearrangementOffSelector
= 1,
188 numberSpacingType
= 6,
190 monospacedNumbersSelector
= 0,
191 proportionalNumbersSelector
= 1,
194 appleReserved1Type = 7,
199 wordInitialSwashesOnSelector
= 0,
200 wordInitialSwashesOffSelector
= 1,
201 wordFinalSwashesOnSelector
= 2,
202 wordFinalSwashesOffSelector
= 3,
203 lineInitialSwashesOnSelector
= 4,
204 lineInitialSwashesOffSelector
= 5,
205 lineFinalSwashesOnSelector
= 6,
206 lineFinalSwashesOffSelector
= 7,
207 nonFinalSwashesOnSelector
= 8,
208 nonFinalSwashesOffSelector
= 9,
212 showDiacriticsSelector
= 0,
213 hideDiacriticsSelector
= 1,
214 decomposeDiacriticsSelector
= 2,
216 verticalPositionType
= 10,
218 normalPositionSelector
= 0,
219 superiorsSelector
= 1,
220 inferiorsSelector
= 2,
221 ordinalsSelector
= 3,
225 noFractionsSelector
= 0,
226 verticalFractionsSelector
= 1,
227 diagonalFractionsSelector
= 2,
230 appleReserved2Type = 12,
233 overlappingCharactersType
= 13,
235 preventOverlapOnSelector
= 0,
236 preventOverlapOffSelector
= 1,
238 typographicExtrasType
= 14,
240 hyphensToEmDashOnSelector
= 0,
241 hyphensToEmDashOffSelector
= 1,
242 hyphenToEnDashOnSelector
= 2,
243 hyphenToEnDashOffSelector
= 3,
244 unslashedZeroOnSelector
= 4,
245 slashedZeroOffSelector
= 4,
246 unslashedZeroOffSelector
= 5,
247 slashedZeroOnSelector
= 5,
248 formInterrobangOnSelector
= 6,
249 formInterrobangOffSelector
= 7,
250 smartQuotesOnSelector
= 8,
251 smartQuotesOffSelector
= 9,
252 periodsToEllipsisOnSelector
= 10,
253 periodsToEllipsisOffSelector
= 11,
255 mathematicalExtrasType
= 15,
257 hyphenToMinusOnSelector
= 0,
258 hyphenToMinusOffSelector
= 1,
259 asteriskToMultiplyOnSelector
= 2,
260 asteriskToMultiplyOffSelector
= 3,
261 slashToDivideOnSelector
= 4,
262 slashToDivideOffSelector
= 5,
263 inequalityLigaturesOnSelector
= 6,
264 inequalityLigaturesOffSelector
= 7,
265 exponentsOnSelector
= 8,
266 exponentsOffSelector
= 9,
268 ornamentSetsType
= 16,
270 noOrnamentsSelector
= 0,
271 dingbatsSelector
= 1,
272 piCharactersSelector
= 2,
273 fleuronsSelector
= 3,
274 decorativeBordersSelector
= 4,
275 internationalSymbolsSelector
= 5,
276 mathSymbolsSelector
= 6,
278 characterAlternativesType
= 17,
280 noAlternatesSelector
= 0,
282 designComplexityType
= 18,
284 designLevel1Selector
= 0,
285 designLevel2Selector
= 1,
286 designLevel3Selector
= 2,
287 designLevel4Selector
= 3,
288 designLevel5Selector
= 4,
289 designLevel6Selector
= 5,
290 designLevel7Selector
= 6,
292 styleOptionsType
= 19,
294 noStyleOptionsSelector
= 0,
295 displayTextSelector
= 1,
296 engravedTextSelector
= 2,
297 illuminatedCapsSelector
= 3,
298 titlingCapsSelector
= 4,
299 tallCapsSelector
= 5,
301 characterShapeType
= 20,
303 traditionalCharactersSelector
= 0,
304 simplifiedCharactersSelector
= 1,
305 jis1978CharactersSelector
= 2,
306 jis1983CharactersSelector
= 3,
307 jis1990CharactersSelector
= 4,
308 traditionalAltOneSelector
= 5,
309 traditionalAltTwoSelector
= 6,
310 traditionalAltThreeSelector
= 7,
311 traditionalAltFourSelector
= 8,
312 traditionalAltFiveSelector
= 9,
313 expertCharactersSelector
= 10,
317 lowerCaseNumbersSelector
= 0,
318 upperCaseNumbersSelector
= 1,
320 textSpacingType
= 22,
322 proportionalTextSelector
= 0,
323 monospacedTextSelector
= 1,
324 halfWidthTextSelector
= 2,
325 normallySpacedTextSelector
= 3,
327 transliterationType
= 23,
329 noTransliterationSelector
= 0,
330 hanjaToHangulSelector
= 1,
331 hiraganaToKatakanaSelector
= 2,
332 katakanaToHiraganaSelector
= 3,
333 kanaToRomanizationSelector
= 4,
334 romanizationToHiraganaSelector
= 5,
335 romanizationToKatakanaSelector
= 6,
336 hanjaToHangulAltOneSelector
= 7,
337 hanjaToHangulAltTwoSelector
= 8,
338 hanjaToHangulAltThreeSelector
= 9,
342 noAnnotationSelector
= 0,
343 boxAnnotationSelector
= 1,
344 roundedBoxAnnotationSelector
= 2,
345 circleAnnotationSelector
= 3,
346 invertedCircleAnnotationSelector
= 4,
347 parenthesisAnnotationSelector
= 5,
348 periodAnnotationSelector
= 6,
349 romanNumeralAnnotationSelector
= 7,
350 diamondAnnotationSelector
= 8,
352 kanaSpacingType
= 25,
354 fullWidthKanaSelector
= 0,
355 proportionalKanaSelector
= 1,
357 ideographicSpacingType
= 26,
359 fullWidthIdeographsSelector
= 0,
360 proportionalIdeographsSelector
= 1,
362 cjkRomanSpacingType
= 103,
364 halfWidthCJKRomanSelector
= 0,
365 proportionalCJKRomanSelector
= 1,
366 defaultCJKRomanSelector
= 2,
367 fullWidthCJKRomanSelector
= 3,
371 rubyKanaOnSelector
= 2,
372 rubyKanaOffSelector
= 3,
374 /* The following types are provided for compatibility; note that
375 their use is deprecated. */
377 adobeCharacterSpacingType
= 100, /* prefer 22 */
378 adobeKanaSpacingType
= 101, /* prefer 25 */
379 adobeKanjiSpacingType
= 102, /* prefer 26 */
380 adobeSquareLigatures
= 104, /* prefer 1 */