2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
*
|
2004-04-12 18:51:31 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
|
2000-11-28 20:56:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "MorphTables.h"
|
|
|
|
#include "SubtableProcessor.h"
|
2000-12-21 02:52:24 +00:00
|
|
|
#include "NonContextualGlyphSubst.h"
|
|
|
|
#include "NonContextualGlyphSubstProc.h"
|
2000-11-28 20:56:52 +00:00
|
|
|
#include "SimpleArrayProcessor.h"
|
2004-04-12 18:51:31 +00:00
|
|
|
#include "LEGlyphStorage.h"
|
2000-11-28 20:56:52 +00:00
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2002-06-29 00:04:16 +00:00
|
|
|
const char SimpleArrayProcessor::fgClassID=0;
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
SimpleArrayProcessor::SimpleArrayProcessor()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
SimpleArrayProcessor::SimpleArrayProcessor(const MorphSubtableHeader *morphSubtableHeader)
|
2000-11-28 20:56:52 +00:00
|
|
|
: NonContextualGlyphSubstitutionProcessor(morphSubtableHeader)
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
simpleArrayLookupTable = (const SimpleArrayLookupTable *) &header->table;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleArrayProcessor::~SimpleArrayProcessor()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void SimpleArrayProcessor::process(LEGlyphStorage &glyphStorage)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2004-04-12 18:51:31 +00:00
|
|
|
le_int32 glyphCount = glyphStorage.getGlyphCount();
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int32 glyph;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
for (glyph = 0; glyph < glyphCount; glyph += 1) {
|
2004-04-12 18:51:31 +00:00
|
|
|
LEGlyphID thisGlyph = glyphStorage[glyph];
|
|
|
|
if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) {
|
|
|
|
TTGlyphID newGlyph = SWAPW(simpleArrayLookupTable->valueArray[LE_GET_GLYPH(thisGlyph)]);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|