os/textandloc/fontservices/textshaperplugin/IcuSource/layout/ExtensionSubtables.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/ExtensionSubtables.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,39 @@
1.4 +/*
1.5 + * %W% %E%
1.6 + *
1.7 + * (C) Copyright IBM Corp. 2002 - All Rights Reserved
1.8 + *
1.9 + */
1.10 +
1.11 +#include "LETypes.h"
1.12 +#include "OpenTypeTables.h"
1.13 +#include "GlyphSubstitutionTables.h"
1.14 +#include "LookupProcessor.h"
1.15 +#include "ExtensionSubtables.h"
1.16 +#include "GlyphIterator.h"
1.17 +#include "LESwaps.h"
1.18 +
1.19 +U_NAMESPACE_BEGIN
1.20 +
1.21 +
1.22 +// FIXME: should look at the format too... maybe have a sub-class for it?
1.23 +le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType,
1.24 + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance,
1.25 + LEErrorCode& success) const
1.26 +{
1.27 + if (LE_FAILURE(success)) {
1.28 + return 0;
1.29 + }
1.30 + le_uint16 elt = SWAPW(extensionLookupType);
1.31 +
1.32 + if (elt != lookupType) {
1.33 + le_uint32 extOffset = SWAPL(extensionOffset);
1.34 + LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset);
1.35 +
1.36 + return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success);
1.37 + }
1.38 +
1.39 + return 0;
1.40 +}
1.41 +
1.42 +U_NAMESPACE_END