1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/MarkArrays.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,39 @@
1.4 +/*
1.5 + *
1.6 + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
1.7 + *
1.8 + */
1.9 +
1.10 +#include "LETypes.h"
1.11 +#include "LEFontInstance.h"
1.12 +#include "OpenTypeTables.h"
1.13 +#include "AnchorTables.h"
1.14 +#include "MarkArrays.h"
1.15 +#include "LESwaps.h"
1.16 +
1.17 +U_NAMESPACE_BEGIN
1.18 +
1.19 +le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance,
1.20 + LEPoint &anchor) const
1.21 +{
1.22 + le_int32 markClass = -1;
1.23 +
1.24 + if (coverageIndex >= 0) {
1.25 + le_uint16 mCount = SWAPW(markCount);
1.26 +
1.27 + if (coverageIndex < mCount) {
1.28 + const MarkRecord *markRecord = &markRecordArray[coverageIndex];
1.29 + Offset anchorTableOffset = SWAPW(markRecord->markAnchorTableOffset);
1.30 + const AnchorTable *anchorTable = (AnchorTable *) ((char *) this + anchorTableOffset);
1.31 +
1.32 + anchorTable->getAnchor(glyphID, fontInstance, anchor);
1.33 + markClass = SWAPW(markRecord->markClass);
1.34 + }
1.35 +
1.36 + // XXXX If we get here, the table is mal-formed
1.37 + }
1.38 +
1.39 + return markClass;
1.40 +}
1.41 +
1.42 +U_NAMESPACE_END