2000-12-21 20:01:18 +00:00
|
|
|
/*
|
|
|
|
* %W% %E%
|
|
|
|
*
|
2001-01-19 00:30:17 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
|
2000-12-21 20:01:18 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "LEGlyphFilter.h"
|
|
|
|
#include "OpenTypeTables.h"
|
|
|
|
#include "GlyphSubstitutionTables.h"
|
2000-12-21 21:57:18 +00:00
|
|
|
#include "MultipleSubstSubtables.h"
|
2000-12-21 20:01:18 +00:00
|
|
|
#include "GlyphIterator.h"
|
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const
|
2000-12-21 20:01:18 +00:00
|
|
|
{
|
|
|
|
LEGlyphID glyph = (LEGlyphID) glyphIterator->getCurrGlyphID();
|
|
|
|
le_int32 coverageIndex = getGlyphCoverage(glyph);
|
|
|
|
le_uint16 seqCount = SWAPW(sequenceCount);
|
|
|
|
|
|
|
|
if (coverageIndex >= 0 && coverageIndex < seqCount)
|
|
|
|
{
|
|
|
|
Offset sequenceTableOffset = SWAPW(sequenceTableOffsetArray[coverageIndex]);
|
2001-01-19 00:30:17 +00:00
|
|
|
const SequenceTable *sequenceTable = (const SequenceTable *) ((char *) this + sequenceTableOffset);
|
2000-12-21 20:01:18 +00:00
|
|
|
le_uint16 glyphCount = SWAPW(sequenceTable->glyphCount);
|
|
|
|
|
|
|
|
if (glyphCount == 0) {
|
|
|
|
glyphIterator->setCurrGlyphID(0xFFFF);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Can't do this 'till there's a way to
|
|
|
|
// grow the glyph array...
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2001-10-16 00:39:01 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|