4 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
9 #include "LEGlyphFilter.h"
10 #include "OpenTypeTables.h"
11 #include "GlyphSubstitutionTables.h"
12 #include "MultipleSubstSubtables.h"
13 #include "GlyphIterator.h"
18 le_uint32
MultipleSubstitutionSubtable::process(GlyphIterator
*glyphIterator
, const LEGlyphFilter
*filter
) const
20 LEGlyphID glyph
= glyphIterator
->getCurrGlyphID();
21 le_int32 coverageIndex
= getGlyphCoverage(glyph
);
22 le_uint16 seqCount
= SWAPW(sequenceCount
);
24 if (coverageIndex
>= 0 && coverageIndex
< seqCount
) {
25 Offset sequenceTableOffset
= SWAPW(sequenceTableOffsetArray
[coverageIndex
]);
26 const SequenceTable
*sequenceTable
= (const SequenceTable
*) ((char *) this + sequenceTableOffset
);
27 le_uint16 glyphCount
= SWAPW(sequenceTable
->glyphCount
);
29 if (glyphCount
== 0) {
30 glyphIterator
->setCurrGlyphID(0xFFFF);
32 } else if (glyphCount
>= 1) {
33 TTGlyphID substitute
= SWAPW(sequenceTable
->substituteArray
[0]);
35 if (filter
== NULL
|| filter
->accept(LE_SET_GLYPH(glyph
, substitute
))) {
36 glyphIterator
->setCurrGlyphID(substitute
);
41 // Can't do this 'till there's a way to
42 // grow the glyph array...