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 "OpenTypeTables.h" sl@0: #include "GlyphPositioningTables.h" sl@0: #include "CursiveAttachmentSubtables.h" sl@0: #include "AnchorTables.h" sl@0: #include "GlyphIterator.h" sl@0: #include "OpenTypeUtilities.h" sl@0: #include "LESwaps.h" sl@0: sl@0: U_NAMESPACE_BEGIN sl@0: sl@0: le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const sl@0: { sl@0: LEGlyphID glyphID = glyphIterator->getCurrGlyphID(); sl@0: le_int32 coverageIndex = getGlyphCoverage(glyphID); sl@0: le_uint16 eeCount = SWAPW(entryExitCount); sl@0: sl@0: if (coverageIndex < 0 || coverageIndex >= eeCount) { sl@0: glyphIterator->setCursiveGlyph(); sl@0: return 0; sl@0: } sl@0: sl@0: LEPoint entryAnchor, exitAnchor; sl@0: Offset entryOffset = SWAPW(entryExitRecords[coverageIndex].entryAnchor); sl@0: Offset exitOffset = SWAPW(entryExitRecords[coverageIndex].exitAnchor); sl@0: sl@0: if (entryOffset != 0) { sl@0: const AnchorTable *entryAnchorTable = (const AnchorTable *) ((char *) this + entryOffset); sl@0: sl@0: entryAnchorTable->getAnchor(glyphID, fontInstance, entryAnchor); sl@0: glyphIterator->setCursiveEntryPoint(entryAnchor); sl@0: } sl@0: sl@0: if (exitOffset != 0) { sl@0: const AnchorTable *exitAnchorTable = (const AnchorTable *) ((char *) this + exitOffset); sl@0: sl@0: exitAnchorTable->getAnchor(glyphID, fontInstance, exitAnchor); sl@0: glyphIterator->setCursiveExitPoint(exitAnchor); sl@0: } sl@0: sl@0: return 1; sl@0: } sl@0: sl@0: U_NAMESPACE_END