2 * (C) Copyright IBM Corp. 1998 - 2013 - All Rights Reserved
7 #include "LEFontInstance.h"
8 #include "OpenTypeTables.h"
9 #include "ICUFeatures.h"
11 #include "ScriptAndLanguage.h"
12 #include "GlyphDefinitionTables.h"
13 #include "GlyphPositioningTables.h"
14 #include "SinglePositioningSubtables.h"
15 #include "PairPositioningSubtables.h"
16 #include "CursiveAttachmentSubtables.h"
17 #include "MarkToBasePosnSubtables.h"
18 #include "MarkToLigaturePosnSubtables.h"
19 #include "MarkToMarkPosnSubtables.h"
20 //#include "ContextualPositioningSubtables.h"
21 #include "ContextualSubstSubtables.h"
22 #include "ExtensionSubtables.h"
23 #include "LookupProcessor.h"
24 #include "GlyphPosnLookupProc.h"
29 // Aside from the names, the contextual positioning subtables are
30 // the same as the contextual substitution subtables.
31 typedef ContextualSubstitutionSubtable ContextualPositioningSubtable
;
32 typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable
;
34 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor(
35 const LEReferenceTo
<GlyphPositioningTableHeader
> &glyphPositioningTableHeader
,
38 const FeatureMap
*featureMap
,
39 le_int32 featureMapCount
,
43 glyphPositioningTableHeader
,
44 SWAPW(glyphPositioningTableHeader
->scriptListOffset
),
45 SWAPW(glyphPositioningTableHeader
->featureListOffset
),
46 SWAPW(glyphPositioningTableHeader
->lookupListOffset
),
58 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor()
62 le_uint32
GlyphPositioningLookupProcessor::applySubtable(const LEReferenceTo
<LookupSubtable
> &lookupSubtable
, le_uint16 lookupType
,
63 GlyphIterator
*glyphIterator
,
64 const LEFontInstance
*fontInstance
,
65 LEErrorCode
& success
) const
67 if (LE_FAILURE(success
)) {
80 LEReferenceTo
<SinglePositioningSubtable
> subtable(lookupSubtable
, success
);
82 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
88 LEReferenceTo
<PairPositioningSubtable
> subtable(lookupSubtable
, success
);
90 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
96 LEReferenceTo
<CursiveAttachmentSubtable
> subtable(lookupSubtable
, success
);
98 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
104 LEReferenceTo
<MarkToBasePositioningSubtable
> subtable(lookupSubtable
, success
);
106 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
110 case gpstMarkToLigature
:
112 LEReferenceTo
<MarkToLigaturePositioningSubtable
> subtable(lookupSubtable
, success
);
114 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
120 LEReferenceTo
<MarkToMarkPositioningSubtable
> subtable(lookupSubtable
, success
);
122 delta
= subtable
->process(subtable
, glyphIterator
, fontInstance
, success
);
128 LEReferenceTo
<ContextualPositioningSubtable
> subtable(lookupSubtable
, success
);
130 delta
= subtable
->process(this, glyphIterator
, fontInstance
, success
);
134 case gpstChainedContext
:
136 LEReferenceTo
<ChainingContextualPositioningSubtable
> subtable(lookupSubtable
, success
);
138 delta
= subtable
->process(this, glyphIterator
, fontInstance
, success
);
144 LEReferenceTo
<ExtensionSubtable
> subtable(lookupSubtable
, success
);
146 delta
= subtable
->process(this, lookupType
, glyphIterator
, fontInstance
, success
);
157 GlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor()