os/textandloc/fontservices/textshaperplugin/IcuSource/layout/Lookups.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
 *
sl@0
     3
 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
sl@0
     4
 *
sl@0
     5
 */
sl@0
     6
sl@0
     7
#include "LETypes.h"
sl@0
     8
#include "OpenTypeTables.h"
sl@0
     9
#include "Lookups.h"
sl@0
    10
#include "CoverageTables.h"
sl@0
    11
#include "LESwaps.h"
sl@0
    12
sl@0
    13
U_NAMESPACE_BEGIN
sl@0
    14
sl@0
    15
const LookupTable *LookupListTable::getLookupTable(le_uint16 lookupTableIndex) const
sl@0
    16
{
sl@0
    17
    if (lookupTableIndex >= SWAPW(lookupCount)) {
sl@0
    18
        return 0;
sl@0
    19
    }
sl@0
    20
sl@0
    21
    Offset lookupTableOffset = lookupTableOffsetArray[lookupTableIndex];
sl@0
    22
sl@0
    23
    return (const LookupTable *) ((char *) this + SWAPW(lookupTableOffset));
sl@0
    24
}
sl@0
    25
sl@0
    26
const LookupSubtable *LookupTable::getLookupSubtable(le_uint16 subtableIndex) const
sl@0
    27
{
sl@0
    28
    if (subtableIndex >= SWAPW(subTableCount)) {
sl@0
    29
        return 0;
sl@0
    30
    }
sl@0
    31
sl@0
    32
    Offset subtableOffset = subTableOffsetArray[subtableIndex];
sl@0
    33
sl@0
    34
    return (const LookupSubtable *) ((char *) this + SWAPW(subtableOffset));
sl@0
    35
}
sl@0
    36
sl@0
    37
le_int32 LookupSubtable::getGlyphCoverage(Offset tableOffset, LEGlyphID glyphID) const
sl@0
    38
{
sl@0
    39
    const CoverageTable *coverageTable = (const CoverageTable *) ((char *) this + SWAPW(tableOffset));
sl@0
    40
sl@0
    41
    return coverageTable->getGlyphCoverage(glyphID);
sl@0
    42
}
sl@0
    43
sl@0
    44
U_NAMESPACE_END