os/textandloc/fontservices/textshaperplugin/IcuSource/layout/GlyphSubstLookupProc.cpp
Update contrib.
3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
8 #include "LEGlyphFilter.h"
9 #include "LEFontInstance.h"
10 #include "OpenTypeTables.h"
13 #include "ScriptAndLanguage.h"
14 #include "GlyphDefinitionTables.h"
15 #include "GlyphSubstitutionTables.h"
16 #include "SingleSubstitutionSubtables.h"
17 #include "MultipleSubstSubtables.h"
18 #include "AlternateSubstSubtables.h"
19 #include "LigatureSubstSubtables.h"
20 #include "ContextualSubstSubtables.h"
21 #include "ExtensionSubtables.h"
22 #include "LookupProcessor.h"
23 #include "GlyphSubstLookupProc.h"
28 GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor(
29 const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader,
30 LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const LETag *featureOrder)
32 (char *) glyphSubstitutionTableHeader,
33 SWAPW(glyphSubstitutionTableHeader->scriptListOffset),
34 SWAPW(glyphSubstitutionTableHeader->featureListOffset),
35 SWAPW(glyphSubstitutionTableHeader->lookupListOffset),
36 scriptTag, languageTag, featureOrder), fFilter(filter)
41 GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor()
45 le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(
46 const LookupSubtable *lookupSubtable, le_uint16 lookupType,
47 GlyphIterator *glyphIterator, const LEFontInstance *fontInstance,
48 LEErrorCode& success) const
50 if (LE_FAILURE(success)) {
62 const SingleSubstitutionSubtable *subtable = (const SingleSubstitutionSubtable *) lookupSubtable;
64 delta = subtable->process(glyphIterator, fFilter);
70 const MultipleSubstitutionSubtable *subtable = (const MultipleSubstitutionSubtable *) lookupSubtable;
72 delta = subtable->process(glyphIterator, success, fFilter);
78 const AlternateSubstitutionSubtable *subtable = (const AlternateSubstitutionSubtable *) lookupSubtable;
80 delta = subtable->process(glyphIterator, fFilter);
86 const LigatureSubstitutionSubtable *subtable = (const LigatureSubstitutionSubtable *) lookupSubtable;
88 delta = subtable->process(glyphIterator, fFilter);
94 const ContextualSubstitutionSubtable *subtable = (const ContextualSubstitutionSubtable *) lookupSubtable;
96 delta = subtable->process(this, glyphIterator, fontInstance, success);
100 case gsstChainingContext:
102 const ChainingContextualSubstitutionSubtable *subtable = (const ChainingContextualSubstitutionSubtable *) lookupSubtable;
104 delta = subtable->process(this, glyphIterator, fontInstance, success);
110 const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable;
112 delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success);
123 GlyphSubstitutionLookupProcessor::~GlyphSubstitutionLookupProcessor()