3 * (C) Copyright IBM Corp. 1998 - 2004 - All Rights Reserved
8 #include "LEFontInstance.h"
9 #include "OpenTypeTables.h"
12 #include "ScriptAndLanguage.h"
13 #include "GlyphDefinitionTables.h"
14 #include "GlyphPositioningTables.h"
15 #include "SinglePositioningSubtables.h"
16 #include "PairPositioningSubtables.h"
17 #include "CursiveAttachmentSubtables.h"
18 #include "MarkToBasePosnSubtables.h"
19 #include "MarkToLigaturePosnSubtables.h"
20 #include "MarkToMarkPosnSubtables.h"
21 //#include "ContextualPositioningSubtables.h"
22 #include "ContextualSubstSubtables.h"
23 #include "ExtensionSubtables.h"
24 #include "LookupProcessor.h"
25 #include "GlyphPosnLookupProc.h"
30 // Aside from the names, the contextual positioning subtables are
31 // the same as the contextual substitution subtables.
32 typedef ContextualSubstitutionSubtable ContextualPositioningSubtable
;
33 typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable
;
35 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor(
36 const GlyphPositioningTableHeader
*glyphPositioningTableHeader
,
37 LETag scriptTag
, LETag languageTag
, const LETag
*featureOrder
)
39 (char *) glyphPositioningTableHeader
,
40 SWAPW(glyphPositioningTableHeader
->scriptListOffset
),
41 SWAPW(glyphPositioningTableHeader
->featureListOffset
),
42 SWAPW(glyphPositioningTableHeader
->lookupListOffset
),
43 scriptTag
, languageTag
, featureOrder
)
48 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor()
52 le_uint32
GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable
*lookupSubtable
, le_uint16 lookupType
,
53 GlyphIterator
*glyphIterator
,
54 const LEFontInstance
*fontInstance
) const
65 const SinglePositioningSubtable
*subtable
= (const SinglePositioningSubtable
*) lookupSubtable
;
67 delta
= subtable
->process(glyphIterator
, fontInstance
);
73 const PairPositioningSubtable
*subtable
= (const PairPositioningSubtable
*) lookupSubtable
;
75 delta
= subtable
->process(glyphIterator
, fontInstance
);
81 const CursiveAttachmentSubtable
*subtable
= (const CursiveAttachmentSubtable
*) lookupSubtable
;
83 delta
= subtable
->process(glyphIterator
, fontInstance
);
89 const MarkToBasePositioningSubtable
*subtable
= (const MarkToBasePositioningSubtable
*) lookupSubtable
;
91 delta
= subtable
->process(glyphIterator
, fontInstance
);
95 case gpstMarkToLigature
:
97 const MarkToLigaturePositioningSubtable
*subtable
= (const MarkToLigaturePositioningSubtable
*) lookupSubtable
;
99 delta
= subtable
->process(glyphIterator
, fontInstance
);
105 const MarkToMarkPositioningSubtable
*subtable
= (const MarkToMarkPositioningSubtable
*) lookupSubtable
;
107 delta
= subtable
->process(glyphIterator
, fontInstance
);
113 const ContextualPositioningSubtable
*subtable
= (const ContextualPositioningSubtable
*) lookupSubtable
;
115 delta
= subtable
->process(this, glyphIterator
, fontInstance
);
119 case gpstChainedContext
:
121 const ChainingContextualPositioningSubtable
*subtable
= (const ChainingContextualPositioningSubtable
*) lookupSubtable
;
123 delta
= subtable
->process(this, glyphIterator
, fontInstance
);
129 const ExtensionSubtable
*subtable
= (const ExtensionSubtable
*) lookupSubtable
;
131 delta
= subtable
->process(this, lookupType
, glyphIterator
, fontInstance
);
142 GlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor()