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