sl@0: /* sl@0: * sl@0: * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved sl@0: * sl@0: */ sl@0: sl@0: #include "LETypes.h" sl@0: #include "LEFontInstance.h" sl@0: #include "OpenTypeTables.h" sl@0: #include "GlyphSubstitutionTables.h" sl@0: #include "GlyphIterator.h" sl@0: #include "LookupProcessor.h" sl@0: #include "SubstitutionLookups.h" sl@0: #include "CoverageTables.h" sl@0: #include "LESwaps.h" sl@0: sl@0: U_NAMESPACE_BEGIN sl@0: sl@0: /* sl@0: NOTE: This could be optimized somewhat by keeping track sl@0: of the previous sequenceIndex in the loop and doing next() sl@0: or prev() of the delta between that and the current sl@0: sequenceIndex instead of always resetting to the front. sl@0: */ sl@0: void SubstitutionLookup::applySubstitutionLookups( sl@0: LookupProcessor *lookupProcessor, sl@0: SubstitutionLookupRecord *substLookupRecordArray, sl@0: le_uint16 substCount, sl@0: GlyphIterator *glyphIterator, sl@0: const LEFontInstance *fontInstance, sl@0: le_int32 position, sl@0: LEErrorCode& success) sl@0: { sl@0: if (LE_FAILURE(success)) { sl@0: return; sl@0: } sl@0: sl@0: GlyphIterator tempIterator(*glyphIterator); sl@0: sl@0: for (le_uint16 subst = 0; subst < substCount && LE_SUCCESS(success); subst += 1) { sl@0: le_uint16 sequenceIndex = SWAPW(substLookupRecordArray[subst].sequenceIndex); sl@0: le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex); sl@0: sl@0: tempIterator.setCurrStreamPosition(position); sl@0: tempIterator.next(sequenceIndex); sl@0: sl@0: lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, sl@0: fontInstance, success); sl@0: } sl@0: } sl@0: sl@0: U_NAMESPACE_END