2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
*
|
2013-04-18 21:24:51 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
|
2000-11-28 20:56:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LOOKUPTABLES_H
|
|
|
|
#define __LOOKUPTABLES_H
|
|
|
|
|
2003-01-13 23:15:11 +00:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* \internal
|
|
|
|
*/
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
#include "LETypes.h"
|
|
|
|
#include "LayoutTables.h"
|
2013-04-18 21:24:51 +00:00
|
|
|
#include "LETableReference.h"
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
enum LookupTableFormat
|
|
|
|
{
|
|
|
|
ltfSimpleArray = 0,
|
|
|
|
ltfSegmentSingle = 2,
|
|
|
|
ltfSegmentArray = 4,
|
|
|
|
ltfSingleTable = 6,
|
|
|
|
ltfTrimmedArray = 8
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef le_int16 LookupValue;
|
|
|
|
|
|
|
|
struct LookupTable
|
|
|
|
{
|
|
|
|
le_int16 format;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LookupSegment
|
|
|
|
{
|
2003-02-05 00:05:40 +00:00
|
|
|
TTGlyphID lastGlyph;
|
|
|
|
TTGlyphID firstGlyph;
|
2000-11-28 20:56:52 +00:00
|
|
|
LookupValue value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LookupSingle
|
|
|
|
{
|
2003-02-05 00:05:40 +00:00
|
|
|
TTGlyphID glyph;
|
2000-11-28 20:56:52 +00:00
|
|
|
LookupValue value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BinarySearchLookupTable : LookupTable
|
|
|
|
{
|
|
|
|
le_int16 unitSize;
|
|
|
|
le_int16 nUnits;
|
|
|
|
le_int16 searchRange;
|
|
|
|
le_int16 entrySelector;
|
|
|
|
le_int16 rangeShift;
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
const LookupSegment *lookupSegment(const LETableReference &base, const LookupSegment *segments, LEGlyphID glyph, LEErrorCode &success) const;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
const LookupSingle *lookupSingle(const LETableReference &base, const LookupSingle *entries, LEGlyphID glyph, LEErrorCode &success) const;
|
2000-11-28 20:56:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SimpleArrayLookupTable : LookupTable
|
|
|
|
{
|
|
|
|
LookupValue valueArray[ANY_NUMBER];
|
|
|
|
};
|
2013-04-18 21:24:51 +00:00
|
|
|
LE_VAR_ARRAY(SimpleArrayLookupTable, valueArray)
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
struct SegmentSingleLookupTable : BinarySearchLookupTable
|
|
|
|
{
|
|
|
|
LookupSegment segments[ANY_NUMBER];
|
|
|
|
};
|
2013-04-18 21:24:51 +00:00
|
|
|
LE_VAR_ARRAY(SegmentSingleLookupTable, segments)
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
struct SegmentArrayLookupTable : BinarySearchLookupTable
|
|
|
|
{
|
|
|
|
LookupSegment segments[ANY_NUMBER];
|
|
|
|
};
|
2013-04-18 21:24:51 +00:00
|
|
|
LE_VAR_ARRAY(SegmentArrayLookupTable, segments)
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
struct SingleTableLookupTable : BinarySearchLookupTable
|
|
|
|
{
|
|
|
|
LookupSingle entries[ANY_NUMBER];
|
|
|
|
};
|
2013-04-18 21:24:51 +00:00
|
|
|
LE_VAR_ARRAY(SingleTableLookupTable, entries)
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
struct TrimmedArrayLookupTable : LookupTable
|
|
|
|
{
|
2003-02-05 00:05:40 +00:00
|
|
|
TTGlyphID firstGlyph;
|
|
|
|
TTGlyphID glyphCount;
|
2000-11-28 20:56:52 +00:00
|
|
|
LookupValue valueArray[ANY_NUMBER];
|
|
|
|
};
|
2013-04-18 21:24:51 +00:00
|
|
|
LE_VAR_ARRAY(TrimmedArrayLookupTable, valueArray)
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|
2000-11-28 20:56:52 +00:00
|
|
|
#endif
|