2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
* @(#)SingleTableProcessor.cpp 1.6 00/03/15
|
|
|
|
*
|
2001-01-19 00:30:17 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - 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 "SingleTableProcessor.h"
|
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
SingleTableProcessor::SingleTableProcessor()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
SingleTableProcessor::SingleTableProcessor(const MorphSubtableHeader *moprhSubtableHeader)
|
2000-11-28 20:56:52 +00:00
|
|
|
: NonContextualGlyphSubstitutionProcessor(moprhSubtableHeader)
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) moprhSubtableHeader;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
singleTableLookupTable = (const SingleTableLookupTable *) &header->table;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SingleTableProcessor::~SingleTableProcessor()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SingleTableProcessor::process(LEGlyphID *glyphs, le_int32 *charIndices, le_int32 glyphCount)
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const LookupSingle *entries = singleTableLookupTable->entries;
|
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) {
|
|
|
|
const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(entries, glyphs[glyph]);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (lookupSingle != NULL) {
|
2000-11-28 20:56:52 +00:00
|
|
|
glyphs[glyph] = SWAPW(lookupSingle->value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-10-16 00:39:01 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|