55 // the same as the contextual substitution subtables. |
55 // the same as the contextual substitution subtables. |
56 typedef ContextualSubstitutionSubtable ContextualPositioningSubtable; |
56 typedef ContextualSubstitutionSubtable ContextualPositioningSubtable; |
57 typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable; |
57 typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable; |
58 |
58 |
59 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( |
59 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( |
60 const GlyphPositioningTableHeader *glyphPositioningTableHeader, |
60 const LEReferenceTo<GlyphPositioningTableHeader> &glyphPositioningTableHeader, |
61 LETag scriptTag, |
61 LETag scriptTag, |
62 LETag languageTag, |
62 LETag languageTag, |
63 const FeatureMap *featureMap, |
63 const FeatureMap *featureMap, |
64 le_int32 featureMapCount, |
64 le_int32 featureMapCount, |
65 le_bool featureOrder, |
65 le_bool featureOrder, |
66 LEErrorCode& success) |
66 LEErrorCode& success) |
67 : LookupProcessor( |
67 : LookupProcessor( |
68 (char *) glyphPositioningTableHeader, |
68 glyphPositioningTableHeader, |
69 SWAPW(glyphPositioningTableHeader->scriptListOffset), |
69 SWAPW(glyphPositioningTableHeader->scriptListOffset), |
70 SWAPW(glyphPositioningTableHeader->featureListOffset), |
70 SWAPW(glyphPositioningTableHeader->featureListOffset), |
71 SWAPW(glyphPositioningTableHeader->lookupListOffset), |
71 SWAPW(glyphPositioningTableHeader->lookupListOffset), |
72 scriptTag, |
72 scriptTag, |
73 languageTag, |
73 languageTag, |
82 |
82 |
83 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor() |
83 GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor() |
84 { |
84 { |
85 } |
85 } |
86 |
86 |
87 le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, |
87 le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LEReferenceTo<LookupSubtable> &lookupSubtable, le_uint16 lookupType, |
88 GlyphIterator *glyphIterator, |
88 GlyphIterator *glyphIterator, |
89 const LEFontInstance *fontInstance, |
89 const LEFontInstance *fontInstance, |
90 LEErrorCode& success) const |
90 LEErrorCode& success) const |
91 { |
91 { |
92 if (LE_FAILURE(success)) { |
92 if (LE_FAILURE(success)) { |
100 case 0: |
100 case 0: |
101 break; |
101 break; |
102 |
102 |
103 case gpstSingle: |
103 case gpstSingle: |
104 { |
104 { |
105 const SinglePositioningSubtable *subtable = (const SinglePositioningSubtable *) lookupSubtable; |
105 LEReferenceTo<SinglePositioningSubtable> subtable(lookupSubtable, success); |
106 |
106 |
107 delta = subtable->process(glyphIterator, fontInstance); |
107 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
108 break; |
108 break; |
109 } |
109 } |
110 |
110 |
111 case gpstPair: |
111 case gpstPair: |
112 { |
112 { |
113 const PairPositioningSubtable *subtable = (const PairPositioningSubtable *) lookupSubtable; |
113 LEReferenceTo<PairPositioningSubtable> subtable(lookupSubtable, success); |
114 |
114 |
115 delta = subtable->process(glyphIterator, fontInstance); |
115 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
116 break; |
116 break; |
117 } |
117 } |
118 |
118 |
119 case gpstCursive: |
119 case gpstCursive: |
120 { |
120 { |
121 const CursiveAttachmentSubtable *subtable = (const CursiveAttachmentSubtable *) lookupSubtable; |
121 LEReferenceTo<CursiveAttachmentSubtable> subtable(lookupSubtable, success); |
122 |
122 |
123 delta = subtable->process(glyphIterator, fontInstance); |
123 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
124 break; |
124 break; |
125 } |
125 } |
126 |
126 |
127 case gpstMarkToBase: |
127 case gpstMarkToBase: |
128 { |
128 { |
129 const MarkToBasePositioningSubtable *subtable = (const MarkToBasePositioningSubtable *) lookupSubtable; |
129 LEReferenceTo<MarkToBasePositioningSubtable> subtable(lookupSubtable, success); |
130 |
130 |
131 delta = subtable->process(glyphIterator, fontInstance); |
131 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
132 break; |
132 break; |
133 } |
133 } |
134 |
134 |
135 case gpstMarkToLigature: |
135 case gpstMarkToLigature: |
136 { |
136 { |
137 const MarkToLigaturePositioningSubtable *subtable = (const MarkToLigaturePositioningSubtable *) lookupSubtable; |
137 LEReferenceTo<MarkToLigaturePositioningSubtable> subtable(lookupSubtable, success); |
138 |
138 |
139 delta = subtable->process(glyphIterator, fontInstance); |
139 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
140 break; |
140 break; |
141 } |
141 } |
142 |
142 |
143 case gpstMarkToMark: |
143 case gpstMarkToMark: |
144 { |
144 { |
145 const MarkToMarkPositioningSubtable *subtable = (const MarkToMarkPositioningSubtable *) lookupSubtable; |
145 LEReferenceTo<MarkToMarkPositioningSubtable> subtable(lookupSubtable, success); |
146 |
146 |
147 delta = subtable->process(glyphIterator, fontInstance); |
147 delta = subtable->process(subtable, glyphIterator, fontInstance, success); |
148 break; |
148 break; |
149 } |
149 } |
150 |
150 |
151 case gpstContext: |
151 case gpstContext: |
152 { |
152 { |
153 const ContextualPositioningSubtable *subtable = (const ContextualPositioningSubtable *) lookupSubtable; |
153 LEReferenceTo<ContextualPositioningSubtable> subtable(lookupSubtable, success); |
154 |
154 |
155 delta = subtable->process(this, glyphIterator, fontInstance, success); |
155 delta = subtable->process(this, glyphIterator, fontInstance, success); |
156 break; |
156 break; |
157 } |
157 } |
158 |
158 |
159 case gpstChainedContext: |
159 case gpstChainedContext: |
160 { |
160 { |
161 const ChainingContextualPositioningSubtable *subtable = (const ChainingContextualPositioningSubtable *) lookupSubtable; |
161 LEReferenceTo<ChainingContextualPositioningSubtable> subtable(lookupSubtable, success); |
162 |
162 |
163 delta = subtable->process(this, glyphIterator, fontInstance, success); |
163 delta = subtable->process(this, glyphIterator, fontInstance, success); |
164 break; |
164 break; |
165 } |
165 } |
166 |
166 |
167 case gpstExtension: |
167 case gpstExtension: |
168 { |
168 { |
169 const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable; |
169 LEReferenceTo<ExtensionSubtable> subtable(lookupSubtable, success); |
170 |
170 |
171 delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); |
171 delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); |
172 break; |
172 break; |
173 } |
173 } |
174 |
174 |