2 * @(#)TrimmedArrayProcessor.cpp 1.6 00/03/15
4 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
9 #include "MorphTables.h"
10 #include "SubtableProcessor.h"
11 #include "NonContextualGlyphSubst.h"
12 #include "NonContextualGlyphSubstProc.h"
13 #include "TrimmedArrayProcessor.h"
18 const char TrimmedArrayProcessor::fgClassID
=0;
20 TrimmedArrayProcessor::TrimmedArrayProcessor()
24 TrimmedArrayProcessor::TrimmedArrayProcessor(const MorphSubtableHeader
*morphSubtableHeader
)
25 : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader
)
27 const NonContextualGlyphSubstitutionHeader
*header
= (const NonContextualGlyphSubstitutionHeader
*) morphSubtableHeader
;
29 trimmedArrayLookupTable
= (const TrimmedArrayLookupTable
*) &header
->table
;
30 firstGlyph
= SWAPW(trimmedArrayLookupTable
->firstGlyph
);
31 lastGlyph
= firstGlyph
+ SWAPW(trimmedArrayLookupTable
->glyphCount
);
34 TrimmedArrayProcessor::~TrimmedArrayProcessor()
38 void TrimmedArrayProcessor::process(LEGlyphID
*glyphs
, le_int32
* /*charIndices*/, le_int32 glyphCount
)
42 for (glyph
= 0; glyph
< glyphCount
; glyph
+= 1) {
43 TTGlyphID ttGlyph
= (TTGlyphID
) LE_GET_GLYPH(glyphs
[glyph
]);
45 if ((ttGlyph
> firstGlyph
) && (ttGlyph
< lastGlyph
)) {
46 TTGlyphID newGlyph
= SWAPW(trimmedArrayLookupTable
->valueArray
[ttGlyph
- firstGlyph
]);
48 glyphs
[glyph
] = LE_SET_GLYPH(glyphs
[glyph
], newGlyph
);