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 "MorphTables.h" sl@0: #include "SubtableProcessor.h" sl@0: #include "NonContextualGlyphSubst.h" sl@0: #include "NonContextualGlyphSubstProc.h" sl@0: #include "SegmentSingleProcessor.h" sl@0: #include "LEGlyphStorage.h" sl@0: #include "LESwaps.h" sl@0: sl@0: U_NAMESPACE_BEGIN sl@0: sl@0: UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SegmentSingleProcessor) sl@0: sl@0: SegmentSingleProcessor::SegmentSingleProcessor() sl@0: { sl@0: } sl@0: sl@0: SegmentSingleProcessor::SegmentSingleProcessor(const MorphSubtableHeader *morphSubtableHeader) sl@0: : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader) sl@0: { sl@0: const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader; sl@0: sl@0: segmentSingleLookupTable = (const SegmentSingleLookupTable *) &header->table; sl@0: } sl@0: sl@0: SegmentSingleProcessor::~SegmentSingleProcessor() sl@0: { sl@0: } sl@0: sl@0: void SegmentSingleProcessor::process(LEGlyphStorage &glyphStorage) sl@0: { sl@0: const LookupSegment *segments = segmentSingleLookupTable->segments; sl@0: le_int32 glyphCount = glyphStorage.getGlyphCount(); sl@0: le_int32 glyph; sl@0: sl@0: for (glyph = 0; glyph < glyphCount; glyph += 1) { sl@0: LEGlyphID thisGlyph = glyphStorage[glyph]; sl@0: const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segments, thisGlyph); sl@0: sl@0: if (lookupSegment != NULL) { sl@0: TTGlyphID newGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph) + SWAPW(lookupSegment->value); sl@0: sl@0: glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph); sl@0: } sl@0: } sl@0: } sl@0: sl@0: U_NAMESPACE_END