2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
* @(#)MarkArrays.cpp 1.5 00/03/15
|
|
|
|
*
|
2001-01-19 00:30:17 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
|
2000-11-28 20:56:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "LEFontInstance.h"
|
|
|
|
#include "OpenTypeTables.h"
|
|
|
|
#include "AnchorTables.h"
|
|
|
|
#include "MarkArrays.h"
|
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2000-12-21 01:18:44 +00:00
|
|
|
le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance,
|
2001-01-19 00:30:17 +00:00
|
|
|
LEPoint &anchor) const
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
le_int32 markClass = -1;
|
|
|
|
|
|
|
|
if (coverageIndex >= 0) {
|
|
|
|
le_uint16 mCount = SWAPW(markCount);
|
|
|
|
|
|
|
|
if (coverageIndex < mCount) {
|
2001-01-19 00:30:17 +00:00
|
|
|
const MarkRecord *markRecord = &markRecordArray[coverageIndex];
|
2000-11-28 20:56:52 +00:00
|
|
|
Offset anchorTableOffset = SWAPW(markRecord->markAnchorTableOffset);
|
2001-01-19 00:30:17 +00:00
|
|
|
const AnchorTable *anchorTable = (AnchorTable *) ((char *) this + anchorTableOffset);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
anchorTable->getAnchor(glyphID, fontInstance, anchor);
|
|
|
|
markClass = SWAPW(markRecord->markClass);
|
|
|
|
}
|
|
|
|
|
|
|
|
// XXXX If we get here, the table is mal-formed
|
|
|
|
}
|
|
|
|
|
|
|
|
return markClass;
|
|
|
|
}
|
2001-10-16 00:39:01 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|