fontservices/textshaperplugin/IcuSource/layout/ExtensionSubtables.cpp
changeset 0 1fb32624e06b
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     1 /*
       
     2  * %W% %E%
       
     3  *
       
     4  * (C) Copyright IBM Corp. 2002 - All Rights Reserved
       
     5  *
       
     6  */
       
     7 
       
     8 #include "LETypes.h"
       
     9 #include "OpenTypeTables.h"
       
    10 #include "GlyphSubstitutionTables.h"
       
    11 #include "LookupProcessor.h"
       
    12 #include "ExtensionSubtables.h"
       
    13 #include "GlyphIterator.h"
       
    14 #include "LESwaps.h"
       
    15 
       
    16 U_NAMESPACE_BEGIN
       
    17 
       
    18 
       
    19 // FIXME: should look at the format too... maybe have a sub-class for it?
       
    20 le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType,
       
    21                                       GlyphIterator *glyphIterator, const LEFontInstance *fontInstance,
       
    22                                       LEErrorCode& success) const
       
    23 {
       
    24     if (LE_FAILURE(success)) {
       
    25         return 0;
       
    26     }
       
    27     le_uint16 elt = SWAPW(extensionLookupType);
       
    28 
       
    29     if (elt != lookupType) {
       
    30         le_uint32 extOffset = SWAPL(extensionOffset);
       
    31         LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset);
       
    32 
       
    33         return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success);
       
    34     }
       
    35 
       
    36     return 0;
       
    37 }
       
    38 
       
    39 U_NAMESPACE_END