os/textandloc/fontservices/textshaperplugin/IcuSource/layout/LookupTables.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/LookupTables.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,90 @@
     1.4 +/*
     1.5 + *
     1.6 + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
     1.7 + *
     1.8 + */
     1.9 +
    1.10 +#ifndef __LOOKUPTABLES_H
    1.11 +#define __LOOKUPTABLES_H
    1.12 +
    1.13 +/**
    1.14 + * \file
    1.15 + * \internal
    1.16 + */
    1.17 +
    1.18 +#include "LETypes.h"
    1.19 +#include "LayoutTables.h"
    1.20 +
    1.21 +U_NAMESPACE_BEGIN
    1.22 +
    1.23 +enum LookupTableFormat
    1.24 +{
    1.25 +    ltfSimpleArray      = 0,
    1.26 +    ltfSegmentSingle    = 2,
    1.27 +    ltfSegmentArray     = 4,
    1.28 +    ltfSingleTable      = 6,
    1.29 +    ltfTrimmedArray     = 8
    1.30 +};
    1.31 +
    1.32 +typedef le_int16 LookupValue;
    1.33 +
    1.34 +struct LookupTable
    1.35 +{
    1.36 +    le_int16 format;
    1.37 +};
    1.38 +
    1.39 +struct LookupSegment
    1.40 +{
    1.41 +    TTGlyphID   lastGlyph;
    1.42 +    TTGlyphID   firstGlyph;
    1.43 +    LookupValue value;
    1.44 +};
    1.45 +
    1.46 +struct LookupSingle
    1.47 +{
    1.48 +    TTGlyphID   glyph;
    1.49 +    LookupValue value;
    1.50 +};
    1.51 +
    1.52 +struct BinarySearchLookupTable : LookupTable
    1.53 +{
    1.54 +    le_int16 unitSize;
    1.55 +    le_int16 nUnits;
    1.56 +    le_int16 searchRange;
    1.57 +    le_int16 entrySelector;
    1.58 +    le_int16 rangeShift;
    1.59 +
    1.60 +    const LookupSegment *lookupSegment(const LookupSegment *segments, LEGlyphID glyph) const;
    1.61 +
    1.62 +    const LookupSingle *lookupSingle(const LookupSingle *entries, LEGlyphID glyph) const;
    1.63 +};
    1.64 +
    1.65 +struct SimpleArrayLookupTable : LookupTable
    1.66 +{
    1.67 +    LookupValue valueArray[ANY_NUMBER];
    1.68 +};
    1.69 +
    1.70 +struct SegmentSingleLookupTable : BinarySearchLookupTable
    1.71 +{
    1.72 +    LookupSegment segments[ANY_NUMBER];
    1.73 +};
    1.74 +
    1.75 +struct SegmentArrayLookupTable : BinarySearchLookupTable
    1.76 +{
    1.77 +    LookupSegment segments[ANY_NUMBER];
    1.78 +};
    1.79 +
    1.80 +struct SingleTableLookupTable : BinarySearchLookupTable
    1.81 +{
    1.82 +    LookupSingle entries[ANY_NUMBER];
    1.83 +};
    1.84 +
    1.85 +struct TrimmedArrayLookupTable : LookupTable
    1.86 +{
    1.87 +    TTGlyphID   firstGlyph;
    1.88 +    TTGlyphID   glyphCount;
    1.89 +    LookupValue valueArray[ANY_NUMBER];
    1.90 +};
    1.91 +
    1.92 +U_NAMESPACE_END
    1.93 +#endif