2 * (C) Copyright IBM Corp. 1998 - 2013 - All Rights Reserved
7 #include "OpenTypeTables.h"
8 #include "GlyphPositioningTables.h"
9 #include "CursiveAttachmentSubtables.h"
10 #include "AnchorTables.h"
11 #include "GlyphIterator.h"
12 #include "OpenTypeUtilities.h"
17 le_uint32
CursiveAttachmentSubtable::process(const LEReferenceTo
<CursiveAttachmentSubtable
> &base
, GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
, LEErrorCode
&success
) const
19 LEGlyphID glyphID
= glyphIterator
->getCurrGlyphID();
20 le_int32 coverageIndex
= getGlyphCoverage(base
, glyphID
, success
);
21 le_uint16 eeCount
= SWAPW(entryExitCount
);
23 if (coverageIndex
< 0 || coverageIndex
>= eeCount
) {
24 glyphIterator
->setCursiveGlyph();
28 LEPoint entryAnchor
, exitAnchor
;
29 Offset entryOffset
= SWAPW(entryExitRecords
[coverageIndex
].entryAnchor
);
30 Offset exitOffset
= SWAPW(entryExitRecords
[coverageIndex
].exitAnchor
);
32 if (entryOffset
!= 0) {
33 const AnchorTable
*entryAnchorTable
= (const AnchorTable
*) ((char *) this + entryOffset
);
35 entryAnchorTable
->getAnchor(glyphID
, fontInstance
, entryAnchor
);
36 glyphIterator
->setCursiveEntryPoint(entryAnchor
);
38 //glyphIterator->clearCursiveEntryPoint();
41 if (exitOffset
!= 0) {
42 const AnchorTable
*exitAnchorTable
= (const AnchorTable
*) ((char *) this + exitOffset
);
44 exitAnchorTable
->getAnchor(glyphID
, fontInstance
, exitAnchor
);
45 glyphIterator
->setCursiveExitPoint(exitAnchor
);
47 //glyphIterator->clearCursiveExitPoint();