3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
8 #include "LEFontInstance.h"
9 #include "OpenTypeTables.h"
10 #include "GlyphSubstitutionTables.h"
11 #include "GlyphIterator.h"
12 #include "LookupProcessor.h"
13 #include "SubstitutionLookups.h"
14 #include "CoverageTables.h"
20 NOTE: This could be optimized somewhat by keeping track
21 of the previous sequenceIndex in the loop and doing next()
22 or prev() of the delta between that and the current
23 sequenceIndex instead of always resetting to the front.
25 void SubstitutionLookup::applySubstitutionLookups(
26 LookupProcessor
*lookupProcessor
,
27 SubstitutionLookupRecord
*substLookupRecordArray
,
29 GlyphIterator
*glyphIterator
,
30 const LEFontInstance
*fontInstance
,
33 GlyphIterator
tempIterator(*glyphIterator
);
35 for (le_uint16 subst
= 0; subst
< substCount
; subst
+= 1) {
36 le_uint16 sequenceIndex
= SWAPW(substLookupRecordArray
[subst
].sequenceIndex
);
37 le_uint16 lookupListIndex
= SWAPW(substLookupRecordArray
[subst
].lookupListIndex
);
39 tempIterator
.setCurrStreamPosition(position
);
40 tempIterator
.next(sequenceIndex
);
42 lookupProcessor
->applySingleLookup(lookupListIndex
, &tempIterator
, fontInstance
);