2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
*
|
2005-01-14 17:25:11 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
|
2000-11-28 20:56:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "LEFontInstance.h"
|
|
|
|
#include "OpenTypeTables.h"
|
|
|
|
#include "GlyphPositioningTables.h"
|
|
|
|
#include "SinglePositioningSubtables.h"
|
|
|
|
#include "ValueRecords.h"
|
|
|
|
#include "GlyphIterator.h"
|
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
le_uint32 SinglePositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
switch(SWAPW(subtableFormat))
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const SinglePositioningFormat1Subtable *subtable = (const SinglePositioningFormat1Subtable *) this;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
return subtable->process(glyphIterator, fontInstance);
|
|
|
|
}
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const SinglePositioningFormat2Subtable *subtable = (const SinglePositioningFormat2Subtable *) this;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
return subtable->process(glyphIterator, fontInstance);
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
le_uint32 SinglePositioningFormat1Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2003-02-05 00:05:40 +00:00
|
|
|
LEGlyphID glyph = glyphIterator->getCurrGlyphID();
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int32 coverageIndex = getGlyphCoverage(glyph);
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (coverageIndex >= 0) {
|
2005-01-14 17:25:11 +00:00
|
|
|
valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
le_uint32 SinglePositioningFormat2Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2003-02-05 00:05:40 +00:00
|
|
|
LEGlyphID glyph = glyphIterator->getCurrGlyphID();
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int16 coverageIndex = (le_int16) getGlyphCoverage(glyph);
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (coverageIndex >= 0) {
|
2005-01-14 17:25:11 +00:00
|
|
|
valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|