~ubuntu-branches/ubuntu/quantal/icu/quantal

« back to all changes in this revision

Viewing changes to source/layout/MarkArrays.cpp

  • Committer: Package Import Robot
  • Author(s): Yves Arrouye
  • Date: 2002-03-03 15:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20020303153113-3ssceqlq45xbmbnc
Tags: upstream-2.0-2.1pre20020303
ImportĀ upstreamĀ versionĀ 2.0-2.1pre20020303

Show diffs side-by-side

added added

removed removed

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