3 * (C) Copyright IBM Corp. 1998-2005 - 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 FeatureMap
*featureMap
, le_int32 featureMapCount
, le_bool featureOrder
)
32 (char *) glyphSubstitutionTableHeader
,
33 SWAPW(glyphSubstitutionTableHeader
->scriptListOffset
),
34 SWAPW(glyphSubstitutionTableHeader
->featureListOffset
),
35 SWAPW(glyphSubstitutionTableHeader
->lookupListOffset
),
36 scriptTag
, languageTag
, featureMap
, featureMapCount
, featureOrder
), fFilter(filter
)
41 GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor()
45 le_uint32
GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable
*lookupSubtable
, le_uint16 lookupType
,
46 GlyphIterator
*glyphIterator
, const LEFontInstance
*fontInstance
) const
57 const SingleSubstitutionSubtable
*subtable
= (const SingleSubstitutionSubtable
*) lookupSubtable
;
59 delta
= subtable
->process(glyphIterator
, fFilter
);
65 const MultipleSubstitutionSubtable
*subtable
= (const MultipleSubstitutionSubtable
*) lookupSubtable
;
67 delta
= subtable
->process(glyphIterator
, fFilter
);
73 const AlternateSubstitutionSubtable
*subtable
= (const AlternateSubstitutionSubtable
*) lookupSubtable
;
75 delta
= subtable
->process(glyphIterator
, fFilter
);
81 const LigatureSubstitutionSubtable
*subtable
= (const LigatureSubstitutionSubtable
*) lookupSubtable
;
83 delta
= subtable
->process(glyphIterator
, fFilter
);
89 const ContextualSubstitutionSubtable
*subtable
= (const ContextualSubstitutionSubtable
*) lookupSubtable
;
91 delta
= subtable
->process(this, glyphIterator
, fontInstance
);
95 case gsstChainingContext
:
97 const ChainingContextualSubstitutionSubtable
*subtable
= (const ChainingContextualSubstitutionSubtable
*) lookupSubtable
;
99 delta
= subtable
->process(this, glyphIterator
, fontInstance
);
105 const ExtensionSubtable
*subtable
= (const ExtensionSubtable
*) lookupSubtable
;
107 delta
= subtable
->process(this, lookupType
, glyphIterator
, fontInstance
);
118 GlyphSubstitutionLookupProcessor::~GlyphSubstitutionLookupProcessor()