3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
8 #include "LEGlyphFilter.h"
9 #include "LEFontInstance.h"
10 #include "OpenTypeTables.h"
11 #include "ICUFeatures.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 LEReferenceTo
<GlyphSubstitutionTableHeader
> &glyphSubstitutionTableHeader
,
32 const LEGlyphFilter
*filter
,
33 const FeatureMap
*featureMap
,
34 le_int32 featureMapCount
,
38 glyphSubstitutionTableHeader
,
39 SWAPW(glyphSubstitutionTableHeader
->scriptListOffset
),
40 SWAPW(glyphSubstitutionTableHeader
->featureListOffset
),
41 SWAPW(glyphSubstitutionTableHeader
->lookupListOffset
),
42 scriptTag
, languageTag
, featureMap
, featureMapCount
, featureOrder
, success
), fFilter(filter
)
47 GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor()
51 le_uint32
GlyphSubstitutionLookupProcessor::applySubtable(const LEReferenceTo
<LookupSubtable
> &lookupSubtable
, le_uint16 lookupType
,
52 GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
, LEErrorCode
& success
) const
54 if (LE_FAILURE(success
)) {
67 const LEReferenceTo
<SingleSubstitutionSubtable
> subtable(lookupSubtable
, success
);
69 delta
= subtable
->process(subtable
, glyphIterator
, success
, fFilter
);
75 const LEReferenceTo
<MultipleSubstitutionSubtable
> subtable(lookupSubtable
, success
);
77 delta
= subtable
->process(subtable
, glyphIterator
, success
, fFilter
);
83 const LEReferenceTo
<AlternateSubstitutionSubtable
> subtable(lookupSubtable
, success
);
85 delta
= subtable
->process(subtable
, glyphIterator
, success
, fFilter
);
91 const LEReferenceTo
<LigatureSubstitutionSubtable
> subtable(lookupSubtable
, success
);
93 delta
= subtable
->process(subtable
, glyphIterator
, success
, fFilter
);
99 const LEReferenceTo
<ContextualSubstitutionSubtable
> subtable(lookupSubtable
, success
);
101 delta
= subtable
->process(this, glyphIterator
, fontInstance
, success
);
105 case gsstChainingContext
:
107 const LEReferenceTo
<ChainingContextualSubstitutionSubtable
> subtable(lookupSubtable
, success
);
109 delta
= subtable
->process(this, glyphIterator
, fontInstance
, success
);
115 const LEReferenceTo
<ExtensionSubtable
> subtable(lookupSubtable
, success
);
117 delta
= subtable
->process(this, lookupType
, glyphIterator
, fontInstance
, success
);
128 GlyphSubstitutionLookupProcessor::~GlyphSubstitutionLookupProcessor()