mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-1943 don't do mark to mark positioning between two marks attached to different ligature components
X-SVN-Rev: 8920
This commit is contained in:
parent
a28d72cd79
commit
b5b02ebdd8
3 changed files with 30 additions and 2 deletions
|
@ -489,23 +489,50 @@ le_bool GlyphIterator::prev(le_uint32 delta)
|
|||
return prevInternal(delta) && hasFeatureTag();
|
||||
}
|
||||
|
||||
// FIXME: Why in the world did I write the code that's #if 0'd out?
|
||||
le_int32 GlyphIterator::getMarkComponent(le_int32 markPosition) const
|
||||
{
|
||||
le_int32 component = 0;
|
||||
#if 0
|
||||
le_int32 posn, start = position, end = markPosition;
|
||||
|
||||
if (markPosition < position) {
|
||||
start = markPosition;
|
||||
end = position;
|
||||
}
|
||||
}
|
||||
|
||||
for (posn = start; posn <= end; posn += 1) {
|
||||
if (glyphs[posn] == 0xFFFE) {
|
||||
component += 1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
le_int32 posn;
|
||||
|
||||
for (posn = position; posn != markPosition; posn += direction) {
|
||||
if (glyphs[posn] == 0xFFFE) {
|
||||
component += 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
// This is basically prevInternal except that it
|
||||
// doesn't take a delta argument, and it doesn't
|
||||
// filter out 0xFFFE glyphs.
|
||||
le_bool GlyphIterator::findMark2Glyph()
|
||||
{
|
||||
le_int32 newPosition = position;
|
||||
|
||||
do {
|
||||
newPosition -= direction;
|
||||
} while (newPosition != prevLimit && glyphs[newPosition] != 0xFFFE && filterGlyph(newPosition));
|
||||
|
||||
position = newPosition;
|
||||
|
||||
return position != prevLimit;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
void getCurrGlyphPositionAdjustment(GlyphPositionAdjustment &adjustment) const;
|
||||
|
||||
le_int32 getMarkComponent(le_int32 markPosition) const;
|
||||
le_bool findMark2Glyph();
|
||||
|
||||
void getCursiveLastExitPoint(LEPoint &exitPoint) const;
|
||||
LEGlyphID getCursiveLastGlyphID() const;
|
||||
|
|
|
@ -20,7 +20,7 @@ U_NAMESPACE_BEGIN
|
|||
|
||||
LEGlyphID MarkToMarkPositioningSubtable::findMark2Glyph(GlyphIterator *glyphIterator) const
|
||||
{
|
||||
if (glyphIterator->prev()) {
|
||||
if (glyphIterator->findMark2Glyph()) {
|
||||
return glyphIterator->getCurrGlyphID();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue