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