ICU-1068 allow for zero entry, exit anchor table offsets. Reset cursiveFirstPosition in resetCursiveLastExitPoint.

X-SVN-Rev: 8911
This commit is contained in:
Eric Mader 2002-06-20 22:23:58 +00:00
parent 61fee9013d
commit cf90102603
2 changed files with 26 additions and 7 deletions

View File

@ -31,7 +31,7 @@ le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const
LEPoint entryAnchor, exitAnchor, pixels;
if (glyphIterator->hasCursiveLastExitPoint()) {
if (glyphIterator->hasCursiveLastExitPoint() && entryExitRecords[coverageIndex].entryAnchor != 0) {
Offset entryOffset = SWAPW(entryExitRecords[coverageIndex].entryAnchor);
const AnchorTable *entryAnchorTable = (const AnchorTable *) ((char *) this + entryOffset);
@ -65,16 +65,34 @@ le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const
Offset exitOffset = SWAPW(entryExitRecords[coverageIndex].exitAnchor);
const AnchorTable *exitAnchorTable = (const AnchorTable *) ((char *) this + exitOffset);
if (exitOffset != 0) {
const AnchorTable *exitAnchorTable = (const AnchorTable *) ((char *) this + exitOffset);
exitAnchorTable->getAnchor(glyphID, fontInstance, exitAnchor);
exitAnchorTable->getAnchor(glyphID, fontInstance, exitAnchor);
if (!glyphIterator->hasCursiveFirstExitPoint()) {
glyphIterator->setCursiveFirstExitPoint();
if (!glyphIterator->hasCursiveFirstExitPoint()) {
glyphIterator->setCursiveFirstExitPoint();
}
glyphIterator->setCursiveLastExitPoint(exitAnchor);
} else {
/*
* We've got a glyph which is covered but doesn't have an
* exit point. We call setCursiveLastExitPoint just to set
* the position of this glyph, then resetCursiveLastExitPoint
* to do any baseline adjustments that are required for the
* sequence of attached glyphs.
*
* NOTE: we don't really care about the value of
* extiAnchor, because after we reset the last exit
* point, it won't be used. This is a bit of a hack.
* There should probably be a setCursiveLastExitPoint
* call that doesn't take an anchor...
*/
glyphIterator->setCursiveLastExitPoint(exitAnchor);
glyphIterator->resetCursiveLastExitPoint();
}
glyphIterator->setCursiveLastExitPoint(exitAnchor);
return 1;
}

View File

@ -316,6 +316,7 @@ void GlyphIterator::resetCursiveLastExitPoint()
}
cursiveLastPosition = -1;
cursiveFirstPosition = -1;
cursiveBaselineAdjustment = 0;
}
#endif