]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | /* |
b75a7d8f | 2 | * |
57a6839d | 3 | * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved |
b75a7d8f A |
4 | * |
5 | */ | |
6 | ||
7 | #ifndef __LOOKUPS_H | |
8 | #define __LOOKUPS_H | |
9 | ||
10 | /** | |
11 | * \file | |
12 | * \internal | |
13 | */ | |
14 | ||
15 | #include "LETypes.h" | |
16 | #include "OpenTypeTables.h" | |
17 | ||
18 | U_NAMESPACE_BEGIN | |
19 | ||
20 | enum LookupFlags | |
21 | { | |
22 | lfBaselineIsLogicalEnd = 0x0001, // The MS spec. calls this flag "RightToLeft" but this name is more accurate | |
23 | lfIgnoreBaseGlyphs = 0x0002, | |
24 | lfIgnoreLigatures = 0x0004, | |
25 | lfIgnoreMarks = 0x0008, | |
26 | lfReservedMask = 0x00F0, | |
27 | lfMarkAttachTypeMask = 0xFF00, | |
28 | lfMarkAttachTypeShift = 8 | |
29 | }; | |
30 | ||
31 | struct LookupSubtable | |
32 | { | |
33 | le_uint16 subtableFormat; | |
34 | Offset coverageTableOffset; | |
35 | ||
57a6839d | 36 | inline le_int32 getGlyphCoverage(const LEReferenceTo<LookupSubtable> &base, LEGlyphID glyphID, LEErrorCode &success) const; |
73c04bcf | 37 | |
57a6839d A |
38 | le_int32 getGlyphCoverage(const LEReferenceTo<LookupSubtable> &base, Offset tableOffset, LEGlyphID glyphID, LEErrorCode &success) const; |
39 | ||
40 | // convenience | |
41 | inline le_int32 getGlyphCoverage(const LETableReference &base, LEGlyphID glyphID, LEErrorCode &success) const; | |
42 | ||
43 | inline le_int32 getGlyphCoverage(const LETableReference &base, Offset tableOffset, LEGlyphID glyphID, LEErrorCode &success) const; | |
b75a7d8f A |
44 | }; |
45 | ||
46 | struct LookupTable | |
47 | { | |
48 | le_uint16 lookupType; | |
49 | le_uint16 lookupFlags; | |
50 | le_uint16 subTableCount; | |
51 | Offset subTableOffsetArray[ANY_NUMBER]; | |
52 | ||
57a6839d | 53 | const LEReferenceTo<LookupSubtable> getLookupSubtable(const LEReferenceTo<LookupTable> &base, le_uint16 subtableIndex, LEErrorCode &success) const; |
b75a7d8f | 54 | }; |
57a6839d | 55 | LE_VAR_ARRAY(LookupTable, subTableOffsetArray) |
b75a7d8f A |
56 | |
57 | struct LookupListTable | |
58 | { | |
59 | le_uint16 lookupCount; | |
60 | Offset lookupTableOffsetArray[ANY_NUMBER]; | |
61 | ||
57a6839d | 62 | const LEReferenceTo<LookupTable> getLookupTable(const LEReferenceTo<LookupListTable> &base, le_uint16 lookupTableIndex, LEErrorCode &success) const; |
b75a7d8f | 63 | }; |
57a6839d | 64 | LE_VAR_ARRAY(LookupListTable, lookupTableOffsetArray) |
b75a7d8f | 65 | |
57a6839d | 66 | inline le_int32 LookupSubtable::getGlyphCoverage(const LEReferenceTo<LookupSubtable> &base, LEGlyphID glyphID, LEErrorCode &success) const |
b75a7d8f | 67 | { |
57a6839d A |
68 | return getGlyphCoverage(base, coverageTableOffset, glyphID, success); |
69 | } | |
70 | ||
71 | inline le_int32 LookupSubtable::getGlyphCoverage(const LETableReference &base, LEGlyphID glyphID, LEErrorCode &success) const { | |
72 | LEReferenceTo<LookupSubtable> thisRef(base, success, this); | |
73 | return getGlyphCoverage(thisRef, glyphID, success); | |
74 | } | |
75 | ||
76 | inline le_int32 LookupSubtable::getGlyphCoverage(const LETableReference &base, Offset tableOffset, LEGlyphID glyphID, LEErrorCode &success) const { | |
77 | LEReferenceTo<LookupSubtable> thisRef(base, success, this); | |
78 | return getGlyphCoverage(thisRef, tableOffset, glyphID, success); | |
b75a7d8f A |
79 | } |
80 | ||
81 | U_NAMESPACE_END | |
82 | #endif |