2
|
1 |
/*
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
*
|
|
4 |
* This code is free software; you can redistribute it and/or modify it
|
|
5 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
6 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
7 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
8 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
9 |
*
|
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
* accompanied this code).
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License version
|
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
*
|
5506
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
* or visit www.oracle.com if you need additional information or have any
|
|
22 |
* questions.
|
2
|
23 |
*
|
|
24 |
*/
|
|
25 |
|
|
26 |
/*
|
|
27 |
*
|
|
28 |
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
|
|
29 |
*
|
|
30 |
*/
|
|
31 |
|
|
32 |
#include "LETypes.h"
|
|
33 |
#include "OpenTypeTables.h"
|
|
34 |
#include "GlyphDefinitionTables.h"
|
|
35 |
#include "GlyphPositionAdjustments.h"
|
|
36 |
#include "GlyphIterator.h"
|
|
37 |
#include "LEGlyphStorage.h"
|
|
38 |
#include "Lookups.h"
|
|
39 |
#include "LESwaps.h"
|
|
40 |
|
3935
|
41 |
U_NAMESPACE_BEGIN
|
2
|
42 |
|
3935
|
43 |
GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags,
|
16891
|
44 |
FeatureMask theFeatureMask, const LEReferenceTo<GlyphDefinitionTableHeader> &theGlyphDefinitionTableHeader)
|
2
|
45 |
: direction(1), position(-1), nextLimit(-1), prevLimit(-1),
|
|
46 |
glyphStorage(theGlyphStorage), glyphPositionAdjustments(theGlyphPositionAdjustments),
|
7486
|
47 |
srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), glyphGroup(0),
|
16891
|
48 |
glyphClassDefinitionTable(), markAttachClassDefinitionTable()
|
2
|
49 |
|
|
50 |
{
|
16891
|
51 |
LEErrorCode success = LE_NO_ERROR; // TODO
|
2
|
52 |
le_int32 glyphCount = glyphStorage.getGlyphCount();
|
|
53 |
|
16891
|
54 |
if (theGlyphDefinitionTableHeader.isValid()) {
|
|
55 |
glyphClassDefinitionTable = theGlyphDefinitionTableHeader
|
|
56 |
-> getGlyphClassDefinitionTable(theGlyphDefinitionTableHeader, success);
|
|
57 |
markAttachClassDefinitionTable = theGlyphDefinitionTableHeader
|
|
58 |
->getMarkAttachClassDefinitionTable(theGlyphDefinitionTableHeader, success);
|
2
|
59 |
}
|
|
60 |
|
|
61 |
nextLimit = glyphCount;
|
|
62 |
|
|
63 |
if (rightToLeft) {
|
|
64 |
direction = -1;
|
|
65 |
position = glyphCount;
|
|
66 |
nextLimit = -1;
|
|
67 |
prevLimit = glyphCount;
|
|
68 |
}
|
|
69 |
}
|
|
70 |
|
|
71 |
GlyphIterator::GlyphIterator(GlyphIterator &that)
|
|
72 |
: glyphStorage(that.glyphStorage)
|
|
73 |
{
|
|
74 |
direction = that.direction;
|
|
75 |
position = that.position;
|
|
76 |
nextLimit = that.nextLimit;
|
|
77 |
prevLimit = that.prevLimit;
|
|
78 |
|
|
79 |
glyphPositionAdjustments = that.glyphPositionAdjustments;
|
|
80 |
srcIndex = that.srcIndex;
|
|
81 |
destIndex = that.destIndex;
|
|
82 |
lookupFlags = that.lookupFlags;
|
|
83 |
featureMask = that.featureMask;
|
7486
|
84 |
glyphGroup = that.glyphGroup;
|
2
|
85 |
glyphClassDefinitionTable = that.glyphClassDefinitionTable;
|
|
86 |
markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
|
|
87 |
}
|
|
88 |
|
|
89 |
GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask)
|
|
90 |
: glyphStorage(that.glyphStorage)
|
|
91 |
{
|
|
92 |
direction = that.direction;
|
|
93 |
position = that.position;
|
|
94 |
nextLimit = that.nextLimit;
|
|
95 |
prevLimit = that.prevLimit;
|
|
96 |
|
|
97 |
glyphPositionAdjustments = that.glyphPositionAdjustments;
|
|
98 |
srcIndex = that.srcIndex;
|
|
99 |
destIndex = that.destIndex;
|
|
100 |
lookupFlags = that.lookupFlags;
|
|
101 |
featureMask = newFeatureMask;
|
7486
|
102 |
glyphGroup = 0;
|
2
|
103 |
glyphClassDefinitionTable = that.glyphClassDefinitionTable;
|
|
104 |
markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
|
|
105 |
}
|
|
106 |
|
|
107 |
GlyphIterator::GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags)
|
|
108 |
: glyphStorage(that.glyphStorage)
|
|
109 |
{
|
|
110 |
direction = that.direction;
|
|
111 |
position = that.position;
|
|
112 |
nextLimit = that.nextLimit;
|
|
113 |
prevLimit = that.prevLimit;
|
|
114 |
|
|
115 |
glyphPositionAdjustments = that.glyphPositionAdjustments;
|
|
116 |
srcIndex = that.srcIndex;
|
|
117 |
destIndex = that.destIndex;
|
|
118 |
lookupFlags = newLookupFlags;
|
|
119 |
featureMask = that.featureMask;
|
7486
|
120 |
glyphGroup = that.glyphGroup;
|
2
|
121 |
glyphClassDefinitionTable = that.glyphClassDefinitionTable;
|
|
122 |
markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
|
|
123 |
}
|
|
124 |
|
|
125 |
GlyphIterator::~GlyphIterator()
|
|
126 |
{
|
|
127 |
// nothing to do, right?
|
|
128 |
}
|
|
129 |
|
|
130 |
void GlyphIterator::reset(le_uint16 newLookupFlags, FeatureMask newFeatureMask)
|
|
131 |
{
|
|
132 |
position = prevLimit;
|
|
133 |
featureMask = newFeatureMask;
|
7486
|
134 |
glyphGroup = 0;
|
2
|
135 |
lookupFlags = newLookupFlags;
|
|
136 |
}
|
|
137 |
|
7486
|
138 |
LEGlyphID *GlyphIterator::insertGlyphs(le_int32 count, LEErrorCode& success)
|
2
|
139 |
{
|
7486
|
140 |
return glyphStorage.insertGlyphs(position, count, success);
|
2
|
141 |
}
|
|
142 |
|
|
143 |
le_int32 GlyphIterator::applyInsertions()
|
|
144 |
{
|
|
145 |
le_int32 newGlyphCount = glyphStorage.applyInsertions();
|
|
146 |
|
|
147 |
if (direction < 0) {
|
|
148 |
prevLimit = newGlyphCount;
|
|
149 |
} else {
|
|
150 |
nextLimit = newGlyphCount;
|
|
151 |
}
|
|
152 |
|
|
153 |
return newGlyphCount;
|
|
154 |
}
|
|
155 |
|
|
156 |
le_int32 GlyphIterator::getCurrStreamPosition() const
|
|
157 |
{
|
|
158 |
return position;
|
|
159 |
}
|
|
160 |
|
|
161 |
le_bool GlyphIterator::isRightToLeft() const
|
|
162 |
{
|
|
163 |
return direction < 0;
|
|
164 |
}
|
|
165 |
|
|
166 |
le_bool GlyphIterator::ignoresMarks() const
|
|
167 |
{
|
|
168 |
return (lookupFlags & lfIgnoreMarks) != 0;
|
|
169 |
}
|
|
170 |
|
|
171 |
le_bool GlyphIterator::baselineIsLogicalEnd() const
|
|
172 |
{
|
|
173 |
return (lookupFlags & lfBaselineIsLogicalEnd) != 0;
|
|
174 |
}
|
|
175 |
|
|
176 |
LEGlyphID GlyphIterator::getCurrGlyphID() const
|
|
177 |
{
|
|
178 |
if (direction < 0) {
|
|
179 |
if (position <= nextLimit || position >= prevLimit) {
|
|
180 |
return 0xFFFF;
|
|
181 |
}
|
|
182 |
} else {
|
|
183 |
if (position <= prevLimit || position >= nextLimit) {
|
|
184 |
return 0xFFFF;
|
|
185 |
}
|
|
186 |
}
|
|
187 |
|
|
188 |
return glyphStorage[position];
|
|
189 |
}
|
|
190 |
|
|
191 |
void GlyphIterator::getCursiveEntryPoint(LEPoint &entryPoint) const
|
|
192 |
{
|
|
193 |
if (direction < 0) {
|
|
194 |
if (position <= nextLimit || position >= prevLimit) {
|
|
195 |
return;
|
|
196 |
}
|
|
197 |
} else {
|
|
198 |
if (position <= prevLimit || position >= nextLimit) {
|
|
199 |
return;
|
|
200 |
}
|
|
201 |
}
|
|
202 |
|
|
203 |
glyphPositionAdjustments->getEntryPoint(position, entryPoint);
|
|
204 |
}
|
|
205 |
|
|
206 |
void GlyphIterator::getCursiveExitPoint(LEPoint &exitPoint) const
|
|
207 |
{
|
|
208 |
if (direction < 0) {
|
|
209 |
if (position <= nextLimit || position >= prevLimit) {
|
|
210 |
return;
|
|
211 |
}
|
|
212 |
} else {
|
|
213 |
if (position <= prevLimit || position >= nextLimit) {
|
|
214 |
return;
|
|
215 |
}
|
|
216 |
}
|
|
217 |
|
|
218 |
glyphPositionAdjustments->getExitPoint(position, exitPoint);
|
|
219 |
}
|
|
220 |
|
|
221 |
void GlyphIterator::setCurrGlyphID(TTGlyphID glyphID)
|
|
222 |
{
|
|
223 |
LEGlyphID glyph = glyphStorage[position];
|
|
224 |
|
|
225 |
glyphStorage[position] = LE_SET_GLYPH(glyph, glyphID);
|
|
226 |
}
|
|
227 |
|
|
228 |
void GlyphIterator::setCurrStreamPosition(le_int32 newPosition)
|
|
229 |
{
|
|
230 |
if (direction < 0) {
|
|
231 |
if (newPosition >= prevLimit) {
|
|
232 |
position = prevLimit;
|
|
233 |
return;
|
|
234 |
}
|
|
235 |
|
|
236 |
if (newPosition <= nextLimit) {
|
|
237 |
position = nextLimit;
|
|
238 |
return;
|
|
239 |
}
|
|
240 |
} else {
|
|
241 |
if (newPosition <= prevLimit) {
|
|
242 |
position = prevLimit;
|
|
243 |
return;
|
|
244 |
}
|
|
245 |
|
|
246 |
if (newPosition >= nextLimit) {
|
|
247 |
position = nextLimit;
|
|
248 |
return;
|
|
249 |
}
|
|
250 |
}
|
|
251 |
|
|
252 |
position = newPosition - direction;
|
|
253 |
next();
|
|
254 |
}
|
|
255 |
|
|
256 |
void GlyphIterator::setCurrGlyphBaseOffset(le_int32 baseOffset)
|
|
257 |
{
|
|
258 |
if (direction < 0) {
|
|
259 |
if (position <= nextLimit || position >= prevLimit) {
|
|
260 |
return;
|
|
261 |
}
|
|
262 |
} else {
|
|
263 |
if (position <= prevLimit || position >= nextLimit) {
|
|
264 |
return;
|
|
265 |
}
|
|
266 |
}
|
|
267 |
|
|
268 |
glyphPositionAdjustments->setBaseOffset(position, baseOffset);
|
|
269 |
}
|
|
270 |
|
3935
|
271 |
void GlyphIterator::adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
|
|
272 |
float xAdvanceAdjust, float yAdvanceAdjust)
|
2
|
273 |
{
|
|
274 |
if (direction < 0) {
|
|
275 |
if (position <= nextLimit || position >= prevLimit) {
|
|
276 |
return;
|
|
277 |
}
|
|
278 |
} else {
|
|
279 |
if (position <= prevLimit || position >= nextLimit) {
|
|
280 |
return;
|
|
281 |
}
|
|
282 |
}
|
|
283 |
|
|
284 |
glyphPositionAdjustments->adjustXPlacement(position, xPlacementAdjust);
|
|
285 |
glyphPositionAdjustments->adjustYPlacement(position, yPlacementAdjust);
|
|
286 |
glyphPositionAdjustments->adjustXAdvance(position, xAdvanceAdjust);
|
|
287 |
glyphPositionAdjustments->adjustYAdvance(position, yAdvanceAdjust);
|
|
288 |
}
|
|
289 |
|
3935
|
290 |
void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
|
|
291 |
float xAdvanceAdjust, float yAdvanceAdjust)
|
2
|
292 |
{
|
|
293 |
if (direction < 0) {
|
|
294 |
if (position <= nextLimit || position >= prevLimit) {
|
|
295 |
return;
|
|
296 |
}
|
|
297 |
} else {
|
|
298 |
if (position <= prevLimit || position >= nextLimit) {
|
|
299 |
return;
|
|
300 |
}
|
|
301 |
}
|
|
302 |
|
|
303 |
glyphPositionAdjustments->setXPlacement(position, xPlacementAdjust);
|
|
304 |
glyphPositionAdjustments->setYPlacement(position, yPlacementAdjust);
|
|
305 |
glyphPositionAdjustments->setXAdvance(position, xAdvanceAdjust);
|
|
306 |
glyphPositionAdjustments->setYAdvance(position, yAdvanceAdjust);
|
|
307 |
}
|
|
308 |
|
7486
|
309 |
void GlyphIterator::clearCursiveEntryPoint()
|
|
310 |
{
|
|
311 |
if (direction < 0) {
|
|
312 |
if (position <= nextLimit || position >= prevLimit) {
|
|
313 |
return;
|
|
314 |
}
|
|
315 |
} else {
|
|
316 |
if (position <= prevLimit || position >= nextLimit) {
|
|
317 |
return;
|
|
318 |
}
|
|
319 |
}
|
|
320 |
|
|
321 |
glyphPositionAdjustments->clearEntryPoint(position);
|
|
322 |
}
|
|
323 |
|
|
324 |
void GlyphIterator::clearCursiveExitPoint()
|
|
325 |
{
|
|
326 |
if (direction < 0) {
|
|
327 |
if (position <= nextLimit || position >= prevLimit) {
|
|
328 |
return;
|
|
329 |
}
|
|
330 |
} else {
|
|
331 |
if (position <= prevLimit || position >= nextLimit) {
|
|
332 |
return;
|
|
333 |
}
|
|
334 |
}
|
|
335 |
|
|
336 |
glyphPositionAdjustments->clearExitPoint(position);
|
|
337 |
}
|
|
338 |
|
2
|
339 |
void GlyphIterator::setCursiveEntryPoint(LEPoint &entryPoint)
|
|
340 |
{
|
|
341 |
if (direction < 0) {
|
|
342 |
if (position <= nextLimit || position >= prevLimit) {
|
|
343 |
return;
|
|
344 |
}
|
|
345 |
} else {
|
|
346 |
if (position <= prevLimit || position >= nextLimit) {
|
|
347 |
return;
|
|
348 |
}
|
|
349 |
}
|
|
350 |
|
|
351 |
glyphPositionAdjustments->setEntryPoint(position, entryPoint, baselineIsLogicalEnd());
|
|
352 |
}
|
|
353 |
|
|
354 |
void GlyphIterator::setCursiveExitPoint(LEPoint &exitPoint)
|
|
355 |
{
|
|
356 |
if (direction < 0) {
|
|
357 |
if (position <= nextLimit || position >= prevLimit) {
|
|
358 |
return;
|
|
359 |
}
|
|
360 |
} else {
|
|
361 |
if (position <= prevLimit || position >= nextLimit) {
|
|
362 |
return;
|
|
363 |
}
|
|
364 |
}
|
|
365 |
|
|
366 |
glyphPositionAdjustments->setExitPoint(position, exitPoint, baselineIsLogicalEnd());
|
|
367 |
}
|
|
368 |
|
|
369 |
void GlyphIterator::setCursiveGlyph()
|
|
370 |
{
|
|
371 |
if (direction < 0) {
|
|
372 |
if (position <= nextLimit || position >= prevLimit) {
|
|
373 |
return;
|
|
374 |
}
|
|
375 |
} else {
|
|
376 |
if (position <= prevLimit || position >= nextLimit) {
|
|
377 |
return;
|
|
378 |
}
|
|
379 |
}
|
|
380 |
|
|
381 |
glyphPositionAdjustments->setCursiveGlyph(position, baselineIsLogicalEnd());
|
|
382 |
}
|
|
383 |
|
|
384 |
le_bool GlyphIterator::filterGlyph(le_uint32 index) const
|
|
385 |
{
|
16891
|
386 |
LEErrorCode success = LE_NO_ERROR;
|
2
|
387 |
LEGlyphID glyphID = glyphStorage[index];
|
|
388 |
le_int32 glyphClass = gcdNoGlyphClass;
|
|
389 |
|
|
390 |
if (LE_GET_GLYPH(glyphID) >= 0xFFFE) {
|
|
391 |
return TRUE;
|
|
392 |
}
|
|
393 |
|
16891
|
394 |
if (glyphClassDefinitionTable.isValid()) {
|
|
395 |
glyphClass = glyphClassDefinitionTable->getGlyphClass(glyphClassDefinitionTable, glyphID, success);
|
2
|
396 |
}
|
|
397 |
|
|
398 |
switch (glyphClass)
|
|
399 |
{
|
|
400 |
case gcdNoGlyphClass:
|
|
401 |
return FALSE;
|
|
402 |
|
|
403 |
case gcdSimpleGlyph:
|
|
404 |
return (lookupFlags & lfIgnoreBaseGlyphs) != 0;
|
|
405 |
|
|
406 |
case gcdLigatureGlyph:
|
|
407 |
return (lookupFlags & lfIgnoreLigatures) != 0;
|
|
408 |
|
|
409 |
case gcdMarkGlyph:
|
|
410 |
{
|
|
411 |
if ((lookupFlags & lfIgnoreMarks) != 0) {
|
|
412 |
return TRUE;
|
|
413 |
}
|
|
414 |
|
|
415 |
le_uint16 markAttachType = (lookupFlags & lfMarkAttachTypeMask) >> lfMarkAttachTypeShift;
|
|
416 |
|
16891
|
417 |
if ((markAttachType != 0) && (markAttachClassDefinitionTable.isValid())) {
|
|
418 |
return markAttachClassDefinitionTable
|
|
419 |
-> getGlyphClass(markAttachClassDefinitionTable, glyphID, success) != markAttachType;
|
2
|
420 |
}
|
|
421 |
|
|
422 |
return FALSE;
|
|
423 |
}
|
|
424 |
|
|
425 |
case gcdComponentGlyph:
|
|
426 |
return (lookupFlags & lfIgnoreBaseGlyphs) != 0;
|
|
427 |
|
|
428 |
default:
|
|
429 |
return FALSE;
|
|
430 |
}
|
|
431 |
}
|
|
432 |
|
7486
|
433 |
le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup) const
|
2
|
434 |
{
|
|
435 |
if (featureMask == 0) {
|
|
436 |
return TRUE;
|
|
437 |
}
|
|
438 |
|
|
439 |
LEErrorCode success = LE_NO_ERROR;
|
|
440 |
FeatureMask fm = glyphStorage.getAuxData(position, success);
|
|
441 |
|
7486
|
442 |
return ((fm & featureMask) == featureMask) && (!matchGroup || (le_int32)(fm & LE_GLYPH_GROUP_MASK) == glyphGroup);
|
2
|
443 |
}
|
|
444 |
|
|
445 |
le_bool GlyphIterator::findFeatureTag()
|
|
446 |
{
|
7486
|
447 |
//glyphGroup = 0;
|
|
448 |
|
2
|
449 |
while (nextInternal()) {
|
7486
|
450 |
if (hasFeatureTag(FALSE)) {
|
|
451 |
LEErrorCode success = LE_NO_ERROR;
|
|
452 |
|
|
453 |
glyphGroup = (glyphStorage.getAuxData(position, success) & LE_GLYPH_GROUP_MASK);
|
2
|
454 |
return TRUE;
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
|
458 |
return FALSE;
|
|
459 |
}
|
|
460 |
|
|
461 |
|
|
462 |
le_bool GlyphIterator::nextInternal(le_uint32 delta)
|
|
463 |
{
|
|
464 |
le_int32 newPosition = position;
|
|
465 |
|
|
466 |
while (newPosition != nextLimit && delta > 0) {
|
|
467 |
do {
|
|
468 |
newPosition += direction;
|
16891
|
469 |
//fprintf(stderr,"%s:%d:%s: newPosition = %d, delta = %d\n", __FILE__, __LINE__, __FUNCTION__, newPosition, delta);
|
2
|
470 |
} while (newPosition != nextLimit && filterGlyph(newPosition));
|
|
471 |
|
|
472 |
delta -= 1;
|
|
473 |
}
|
|
474 |
|
|
475 |
position = newPosition;
|
|
476 |
|
16891
|
477 |
//fprintf(stderr,"%s:%d:%s: exit position = %d, delta = %d\n", __FILE__, __LINE__, __FUNCTION__, position, delta);
|
2
|
478 |
return position != nextLimit;
|
|
479 |
}
|
|
480 |
|
|
481 |
le_bool GlyphIterator::next(le_uint32 delta)
|
|
482 |
{
|
7486
|
483 |
return nextInternal(delta) && hasFeatureTag(TRUE);
|
2
|
484 |
}
|
|
485 |
|
|
486 |
le_bool GlyphIterator::prevInternal(le_uint32 delta)
|
|
487 |
{
|
|
488 |
le_int32 newPosition = position;
|
|
489 |
|
|
490 |
while (newPosition != prevLimit && delta > 0) {
|
|
491 |
do {
|
|
492 |
newPosition -= direction;
|
16891
|
493 |
//fprintf(stderr,"%s:%d:%s: newPosition = %d, delta = %d\n", __FILE__, __LINE__, __FUNCTION__, newPosition, delta);
|
2
|
494 |
} while (newPosition != prevLimit && filterGlyph(newPosition));
|
|
495 |
|
|
496 |
delta -= 1;
|
|
497 |
}
|
|
498 |
|
|
499 |
position = newPosition;
|
|
500 |
|
16891
|
501 |
//fprintf(stderr,"%s:%d:%s: exit position = %d, delta = %d\n", __FILE__, __LINE__, __FUNCTION__, position, delta);
|
2
|
502 |
return position != prevLimit;
|
|
503 |
}
|
|
504 |
|
|
505 |
le_bool GlyphIterator::prev(le_uint32 delta)
|
|
506 |
{
|
7486
|
507 |
return prevInternal(delta) && hasFeatureTag(TRUE);
|
2
|
508 |
}
|
|
509 |
|
|
510 |
le_int32 GlyphIterator::getMarkComponent(le_int32 markPosition) const
|
|
511 |
{
|
|
512 |
le_int32 component = 0;
|
|
513 |
le_int32 posn;
|
|
514 |
|
|
515 |
for (posn = position; posn != markPosition; posn += direction) {
|
|
516 |
if (glyphStorage[posn] == 0xFFFE) {
|
|
517 |
component += 1;
|
|
518 |
}
|
|
519 |
}
|
|
520 |
|
|
521 |
return component;
|
|
522 |
}
|
|
523 |
|
|
524 |
// This is basically prevInternal except that it
|
|
525 |
// doesn't take a delta argument, and it doesn't
|
|
526 |
// filter out 0xFFFE glyphs.
|
|
527 |
le_bool GlyphIterator::findMark2Glyph()
|
|
528 |
{
|
|
529 |
le_int32 newPosition = position;
|
|
530 |
|
|
531 |
do {
|
|
532 |
newPosition -= direction;
|
3935
|
533 |
} while (newPosition != prevLimit && glyphStorage[newPosition] != 0xFFFE && filterGlyph(newPosition));
|
2
|
534 |
|
|
535 |
position = newPosition;
|
|
536 |
|
|
537 |
return position != prevLimit;
|
|
538 |
}
|
3935
|
539 |
|
|
540 |
U_NAMESPACE_END
|