]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | * @(#)GlyphPosnLookupProc.cpp 1.6 00/03/15 | |
3 | * | |
4 | * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved | |
5 | * | |
6 | */ | |
7 | ||
8 | #include "LETypes.h" | |
9 | #include "LEFontInstance.h" | |
10 | #include "OpenTypeTables.h" | |
11 | #include "Features.h" | |
12 | #include "Lookups.h" | |
13 | #include "ScriptAndLanguage.h" | |
14 | #include "GlyphDefinitionTables.h" | |
15 | #include "GlyphPositioningTables.h" | |
16 | #include "SinglePositioningSubtables.h" | |
17 | #include "PairPositioningSubtables.h" | |
18 | #include "CursiveAttachmentSubtables.h" | |
19 | #include "MarkToBasePosnSubtables.h" | |
20 | #include "MarkToLigaturePosnSubtables.h" | |
21 | #include "MarkToMarkPosnSubtables.h" | |
22 | //#include "ContextualPositioningSubtables.h" | |
23 | #include "ContextualSubstSubtables.h" | |
24 | #include "ExtensionSubtables.h" | |
25 | #include "LookupProcessor.h" | |
26 | #include "GlyphPosnLookupProc.h" | |
27 | #include "LESwaps.h" | |
28 | ||
29 | U_NAMESPACE_BEGIN | |
30 | ||
31 | // Aside from the names, the contextual positioning subtables are | |
32 | // the same as the contextual substitution subtables. | |
33 | typedef ContextualSubstitutionSubtable ContextualPositioningSubtable; | |
34 | typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable; | |
35 | ||
36 | GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( | |
37 | const GlyphPositioningTableHeader *glyphPositioningTableHeader, | |
38 | LETag scriptTag, LETag languageTag, const LETag *featureOrder) | |
39 | : LookupProcessor( | |
40 | (char *) glyphPositioningTableHeader, | |
41 | SWAPW(glyphPositioningTableHeader->scriptListOffset), | |
42 | SWAPW(glyphPositioningTableHeader->featureListOffset), | |
43 | SWAPW(glyphPositioningTableHeader->lookupListOffset), | |
44 | scriptTag, languageTag, featureOrder) | |
45 | { | |
46 | // anything? | |
47 | } | |
48 | ||
49 | GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor() | |
50 | { | |
51 | } | |
52 | ||
53 | le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, | |
54 | GlyphIterator *glyphIterator, | |
55 | const LEFontInstance *fontInstance) const | |
56 | { | |
57 | le_uint32 delta = 0; | |
58 | ||
59 | switch(lookupType) | |
60 | { | |
61 | case 0: | |
62 | break; | |
63 | ||
64 | case gpstSingle: | |
65 | { | |
66 | const SinglePositioningSubtable *subtable = (const SinglePositioningSubtable *) lookupSubtable; | |
67 | ||
68 | delta = subtable->process(glyphIterator, fontInstance); | |
69 | break; | |
70 | } | |
71 | ||
72 | case gpstPair: | |
73 | { | |
74 | const PairPositioningSubtable *subtable = (const PairPositioningSubtable *) lookupSubtable; | |
75 | ||
76 | delta = subtable->process(glyphIterator, fontInstance); | |
77 | break; | |
78 | } | |
79 | ||
80 | case gpstCursive: | |
81 | { | |
82 | const CursiveAttachmentSubtable *subtable = (const CursiveAttachmentSubtable *) lookupSubtable; | |
83 | ||
84 | delta = subtable->process(glyphIterator, fontInstance); | |
85 | break; | |
86 | } | |
87 | ||
88 | case gpstMarkToBase: | |
89 | { | |
90 | const MarkToBasePositioningSubtable *subtable = (const MarkToBasePositioningSubtable *) lookupSubtable; | |
91 | ||
92 | delta = subtable->process(glyphIterator, fontInstance); | |
93 | break; | |
94 | } | |
95 | ||
96 | case gpstMarkToLigature: | |
97 | { | |
98 | const MarkToLigaturePositioningSubtable *subtable = (const MarkToLigaturePositioningSubtable *) lookupSubtable; | |
99 | ||
100 | delta = subtable->process(glyphIterator, fontInstance); | |
101 | break; | |
102 | } | |
103 | ||
104 | case gpstMarkToMark: | |
105 | { | |
106 | const MarkToMarkPositioningSubtable *subtable = (const MarkToMarkPositioningSubtable *) lookupSubtable; | |
107 | ||
108 | delta = subtable->process(glyphIterator, fontInstance); | |
109 | break; | |
110 | } | |
111 | ||
112 | case gpstContext: | |
113 | { | |
114 | const ContextualPositioningSubtable *subtable = (const ContextualPositioningSubtable *) lookupSubtable; | |
115 | ||
116 | delta = subtable->process(this, glyphIterator, fontInstance); | |
117 | break; | |
118 | } | |
119 | ||
120 | case gpstChainedContext: | |
121 | { | |
122 | const ChainingContextualPositioningSubtable *subtable = (const ChainingContextualPositioningSubtable *) lookupSubtable; | |
123 | ||
124 | delta = subtable->process(this, glyphIterator, fontInstance); | |
125 | break; | |
126 | } | |
127 | ||
128 | case gpstExtension: | |
129 | { | |
130 | const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable; | |
131 | ||
132 | delta = subtable->process(this, lookupType, glyphIterator, fontInstance); | |
133 | break; | |
134 | } | |
135 | ||
136 | default: | |
137 | break; | |
138 | } | |
139 | ||
140 | return delta; | |
141 | } | |
142 | ||
143 | GlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor() | |
144 | { | |
145 | } | |
146 | ||
147 | U_NAMESPACE_END |