]> git.saurik.com Git - apple/icu.git/blob - icuSources/layout/Lookups.cpp
ICU-491.11.2.tar.gz
[apple/icu.git] / icuSources / layout / Lookups.cpp
1 /*
2 *
3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
4 *
5 */
6
7 #include "LETypes.h"
8 #include "OpenTypeTables.h"
9 #include "Lookups.h"
10 #include "CoverageTables.h"
11 #include "LESwaps.h"
12
13 U_NAMESPACE_BEGIN
14
15 const LookupTable *LookupListTable::getLookupTable(le_uint16 lookupTableIndex) const
16 {
17 if (lookupTableIndex >= SWAPW(lookupCount)) {
18 return 0;
19 }
20
21 Offset lookupTableOffset = lookupTableOffsetArray[lookupTableIndex];
22
23 return (const LookupTable *) ((char *) this + SWAPW(lookupTableOffset));
24 }
25
26 const LookupSubtable *LookupTable::getLookupSubtable(le_uint16 subtableIndex) const
27 {
28 if (subtableIndex >= SWAPW(subTableCount)) {
29 return 0;
30 }
31
32 Offset subtableOffset = subTableOffsetArray[subtableIndex];
33
34 return (const LookupSubtable *) ((char *) this + SWAPW(subtableOffset));
35 }
36
37 le_int32 LookupSubtable::getGlyphCoverage(Offset tableOffset, LEGlyphID glyphID) const
38 {
39 const CoverageTable *coverageTable = (const CoverageTable *) ((char *) this + SWAPW(tableOffset));
40
41 return coverageTable->getGlyphCoverage(glyphID);
42 }
43
44 U_NAMESPACE_END