sl@0
|
1 |
/*
|
sl@0
|
2 |
*
|
sl@0
|
3 |
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
|
sl@0
|
4 |
*
|
sl@0
|
5 |
*/
|
sl@0
|
6 |
|
sl@0
|
7 |
#include "LETypes.h"
|
sl@0
|
8 |
#include "LEFontInstance.h"
|
sl@0
|
9 |
#include "OpenTypeTables.h"
|
sl@0
|
10 |
#include "AnchorTables.h"
|
sl@0
|
11 |
#include "MarkArrays.h"
|
sl@0
|
12 |
#include "LESwaps.h"
|
sl@0
|
13 |
|
sl@0
|
14 |
U_NAMESPACE_BEGIN
|
sl@0
|
15 |
|
sl@0
|
16 |
le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance,
|
sl@0
|
17 |
LEPoint &anchor) const
|
sl@0
|
18 |
{
|
sl@0
|
19 |
le_int32 markClass = -1;
|
sl@0
|
20 |
|
sl@0
|
21 |
if (coverageIndex >= 0) {
|
sl@0
|
22 |
le_uint16 mCount = SWAPW(markCount);
|
sl@0
|
23 |
|
sl@0
|
24 |
if (coverageIndex < mCount) {
|
sl@0
|
25 |
const MarkRecord *markRecord = &markRecordArray[coverageIndex];
|
sl@0
|
26 |
Offset anchorTableOffset = SWAPW(markRecord->markAnchorTableOffset);
|
sl@0
|
27 |
const AnchorTable *anchorTable = (AnchorTable *) ((char *) this + anchorTableOffset);
|
sl@0
|
28 |
|
sl@0
|
29 |
anchorTable->getAnchor(glyphID, fontInstance, anchor);
|
sl@0
|
30 |
markClass = SWAPW(markRecord->markClass);
|
sl@0
|
31 |
}
|
sl@0
|
32 |
|
sl@0
|
33 |
// XXXX If we get here, the table is mal-formed
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
return markClass;
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
U_NAMESPACE_END
|