os/textandloc/fontservices/textshaperplugin/IcuSource/layout/Lookups.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
 *
sl@0
     3
 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
sl@0
     4
 *
sl@0
     5
 */
sl@0
     6
sl@0
     7
#ifndef __LOOKUPS_H
sl@0
     8
#define __LOOKUPS_H
sl@0
     9
sl@0
    10
/**
sl@0
    11
 * \file
sl@0
    12
 * \internal
sl@0
    13
 */
sl@0
    14
sl@0
    15
#include "LETypes.h"
sl@0
    16
#include "OpenTypeTables.h"
sl@0
    17
sl@0
    18
U_NAMESPACE_BEGIN
sl@0
    19
sl@0
    20
enum LookupFlags
sl@0
    21
{
sl@0
    22
    lfBaselineIsLogicalEnd  = 0x0001,  // The MS spec. calls this flag "RightToLeft" but this name is more accurate 
sl@0
    23
    lfIgnoreBaseGlyphs      = 0x0002,
sl@0
    24
    lfIgnoreLigatures       = 0x0004,
sl@0
    25
    lfIgnoreMarks           = 0x0008,
sl@0
    26
    lfReservedMask          = 0x00F0,
sl@0
    27
    lfMarkAttachTypeMask    = 0xFF00,
sl@0
    28
    lfMarkAttachTypeShift   = 8
sl@0
    29
};
sl@0
    30
sl@0
    31
struct LookupSubtable
sl@0
    32
{
sl@0
    33
    le_uint16 subtableFormat;
sl@0
    34
    Offset    coverageTableOffset;
sl@0
    35
sl@0
    36
    inline le_int32  getGlyphCoverage(LEGlyphID glyphID) const;
sl@0
    37
sl@0
    38
    le_int32  getGlyphCoverage(Offset tableOffset, LEGlyphID glyphID) const;
sl@0
    39
};
sl@0
    40
sl@0
    41
struct LookupTable
sl@0
    42
{
sl@0
    43
    le_uint16       lookupType;
sl@0
    44
    le_uint16       lookupFlags;
sl@0
    45
    le_uint16       subTableCount;
sl@0
    46
    Offset          subTableOffsetArray[ANY_NUMBER];
sl@0
    47
sl@0
    48
    const LookupSubtable  *getLookupSubtable(le_uint16 subtableIndex) const;
sl@0
    49
};
sl@0
    50
sl@0
    51
struct LookupListTable
sl@0
    52
{
sl@0
    53
    le_uint16   lookupCount;
sl@0
    54
    Offset      lookupTableOffsetArray[ANY_NUMBER];
sl@0
    55
sl@0
    56
    const LookupTable *getLookupTable(le_uint16 lookupTableIndex) const;
sl@0
    57
};
sl@0
    58
sl@0
    59
inline le_int32 LookupSubtable::getGlyphCoverage(LEGlyphID glyphID) const
sl@0
    60
{
sl@0
    61
    return getGlyphCoverage(coverageTableOffset, glyphID);
sl@0
    62
}
sl@0
    63
sl@0
    64
U_NAMESPACE_END
sl@0
    65
#endif