3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
8 #include "LEFontInstance.h"
9 #include "OpenTypeTables.h"
10 #include "GlyphPositioningTables.h"
11 #include "SinglePositioningSubtables.h"
12 #include "ValueRecords.h"
13 #include "GlyphIterator.h"
14 #include "GlyphPositionAdjustments.h"
19 le_uint32
SinglePositioningSubtable::process(GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
) const
21 switch(SWAPW(subtableFormat
))
28 const SinglePositioningFormat1Subtable
*subtable
= (const SinglePositioningFormat1Subtable
*) this;
30 return subtable
->process(glyphIterator
, fontInstance
);
35 const SinglePositioningFormat2Subtable
*subtable
= (const SinglePositioningFormat2Subtable
*) this;
37 return subtable
->process(glyphIterator
, fontInstance
);
45 le_uint32
SinglePositioningFormat1Subtable::process(GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
) const
47 LEGlyphID glyph
= glyphIterator
->getCurrGlyphID();
48 le_int32 coverageIndex
= getGlyphCoverage(glyph
);
50 if (coverageIndex
>= 0) {
51 GlyphPositionAdjustment adjustment
;
53 glyphIterator
->getCurrGlyphPositionAdjustment(adjustment
);
55 valueRecord
.adjustPosition(SWAPW(valueFormat
), (const char *) this, adjustment
, fontInstance
);
57 glyphIterator
->setCurrGlyphPositionAdjustment(&adjustment
);
65 le_uint32
SinglePositioningFormat2Subtable::process(GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
) const
67 LEGlyphID glyph
= glyphIterator
->getCurrGlyphID();
68 le_int16 coverageIndex
= (le_int16
) getGlyphCoverage(glyph
);
70 if (coverageIndex
>= 0) {
71 GlyphPositionAdjustment adjustment
;
73 glyphIterator
->getCurrGlyphPositionAdjustment(adjustment
);
75 valueRecordArray
[0].adjustPosition(coverageIndex
, SWAPW(valueFormat
), (const char *) this, adjustment
, fontInstance
);
77 glyphIterator
->setCurrGlyphPositionAdjustment(&adjustment
);