os/textandloc/fontservices/textshaperplugin/IcuSource/layout/Lookups.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/Lookups.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,44 @@
     1.4 +/*
     1.5 + *
     1.6 + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
     1.7 + *
     1.8 + */
     1.9 +
    1.10 +#include "LETypes.h"
    1.11 +#include "OpenTypeTables.h"
    1.12 +#include "Lookups.h"
    1.13 +#include "CoverageTables.h"
    1.14 +#include "LESwaps.h"
    1.15 +
    1.16 +U_NAMESPACE_BEGIN
    1.17 +
    1.18 +const LookupTable *LookupListTable::getLookupTable(le_uint16 lookupTableIndex) const
    1.19 +{
    1.20 +    if (lookupTableIndex >= SWAPW(lookupCount)) {
    1.21 +        return 0;
    1.22 +    }
    1.23 +
    1.24 +    Offset lookupTableOffset = lookupTableOffsetArray[lookupTableIndex];
    1.25 +
    1.26 +    return (const LookupTable *) ((char *) this + SWAPW(lookupTableOffset));
    1.27 +}
    1.28 +
    1.29 +const LookupSubtable *LookupTable::getLookupSubtable(le_uint16 subtableIndex) const
    1.30 +{
    1.31 +    if (subtableIndex >= SWAPW(subTableCount)) {
    1.32 +        return 0;
    1.33 +    }
    1.34 +
    1.35 +    Offset subtableOffset = subTableOffsetArray[subtableIndex];
    1.36 +
    1.37 +    return (const LookupSubtable *) ((char *) this + SWAPW(subtableOffset));
    1.38 +}
    1.39 +
    1.40 +le_int32 LookupSubtable::getGlyphCoverage(Offset tableOffset, LEGlyphID glyphID) const
    1.41 +{
    1.42 +    const CoverageTable *coverageTable = (const CoverageTable *) ((char *) this + SWAPW(tableOffset));
    1.43 +
    1.44 +    return coverageTable->getGlyphCoverage(glyphID);
    1.45 +}
    1.46 +
    1.47 +U_NAMESPACE_END