sl@0: /* sl@0: * sl@0: * (C) Copyright IBM Corp. 1998-2005 - 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 "GlyphPositioningTables.h" sl@0: #include "SinglePositioningSubtables.h" sl@0: #include "ValueRecords.h" sl@0: #include "GlyphIterator.h" sl@0: #include "LESwaps.h" sl@0: sl@0: U_NAMESPACE_BEGIN sl@0: sl@0: le_uint32 SinglePositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const sl@0: { sl@0: switch(SWAPW(subtableFormat)) sl@0: { sl@0: case 0: sl@0: return 0; sl@0: sl@0: case 1: sl@0: { sl@0: const SinglePositioningFormat1Subtable *subtable = (const SinglePositioningFormat1Subtable *) this; sl@0: sl@0: return subtable->process(glyphIterator, fontInstance); sl@0: } sl@0: sl@0: case 2: sl@0: { sl@0: const SinglePositioningFormat2Subtable *subtable = (const SinglePositioningFormat2Subtable *) this; sl@0: sl@0: return subtable->process(glyphIterator, fontInstance); sl@0: } sl@0: sl@0: default: sl@0: return 0; sl@0: } sl@0: } sl@0: sl@0: le_uint32 SinglePositioningFormat1Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const sl@0: { sl@0: LEGlyphID glyph = glyphIterator->getCurrGlyphID(); sl@0: le_int32 coverageIndex = getGlyphCoverage(glyph); sl@0: sl@0: if (coverageIndex >= 0) { sl@0: valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); sl@0: sl@0: return 1; sl@0: } sl@0: sl@0: return 0; sl@0: } sl@0: sl@0: le_uint32 SinglePositioningFormat2Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const sl@0: { sl@0: LEGlyphID glyph = glyphIterator->getCurrGlyphID(); sl@0: le_int16 coverageIndex = (le_int16) getGlyphCoverage(glyph); sl@0: sl@0: if (coverageIndex >= 0) { sl@0: valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); sl@0: sl@0: return 1; sl@0: } sl@0: sl@0: return 0; sl@0: } sl@0: sl@0: U_NAMESPACE_END