mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-2743 don't require feature tag for backtrack and lookahead. Type three chaining contexual subtable should return inputGlyphCount *not* inputGlyphCount + 1!
X-SVN-Rev: 11267
This commit is contained in:
parent
021f1e9ae2
commit
2dd931b10c
3 changed files with 27 additions and 4 deletions
|
@ -326,6 +326,8 @@ le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor
|
|||
}
|
||||
}
|
||||
|
||||
const LETag emptyTag = 0;
|
||||
|
||||
le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator,
|
||||
const LEFontInstance *fontInstance) const
|
||||
{
|
||||
|
@ -341,7 +343,7 @@ le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupPro
|
|||
(const ChainSubRuleSetTable *) ((char *) this + chainSubRuleSetTableOffset);
|
||||
le_uint16 chainSubRuleCount = SWAPW(chainSubRuleSetTable->chainSubRuleCount);
|
||||
le_int32 position = glyphIterator->getCurrStreamPosition();
|
||||
GlyphIterator tempIterator(*glyphIterator);
|
||||
GlyphIterator tempIterator(*glyphIterator, emptyTag);
|
||||
|
||||
for (le_uint16 subRule = 0; subRule < chainSubRuleCount; subRule += 1) {
|
||||
Offset chainSubRuleTableOffset =
|
||||
|
@ -413,7 +415,7 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupPro
|
|||
(const ChainSubClassSetTable *) ((char *) this + chainSubClassSetTableOffset);
|
||||
le_uint16 chainSubClassRuleCount = SWAPW(chainSubClassSetTable->chainSubClassRuleCount);
|
||||
le_int32 position = glyphIterator->getCurrStreamPosition();
|
||||
GlyphIterator tempIterator(*glyphIterator);
|
||||
GlyphIterator tempIterator(*glyphIterator, emptyTag);
|
||||
|
||||
for (le_uint16 scRule = 0; scRule < chainSubClassRuleCount; scRule += 1) {
|
||||
Offset chainSubClassRuleTableOffset =
|
||||
|
@ -475,7 +477,7 @@ le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupPro
|
|||
const Offset *lookaheadCoverageTableOffsetArray = &inputCoverageTableOffsetArray[inputGlyphCount + 1];
|
||||
le_uint16 substCount = (le_uint16) SWAPW(lookaheadCoverageTableOffsetArray[lookaheadGlyphCount]);
|
||||
le_int32 position = glyphIterator->getCurrStreamPosition();
|
||||
GlyphIterator tempIterator(*glyphIterator);
|
||||
GlyphIterator tempIterator(*glyphIterator, emptyTag);
|
||||
|
||||
if (! tempIterator.prev(backtrkGlyphCount)) {
|
||||
return 0;
|
||||
|
@ -507,7 +509,7 @@ le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupPro
|
|||
|
||||
ContextualSubstitutionBase::applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position);
|
||||
|
||||
return inputGlyphCount + 1;
|
||||
return inputGlyphCount;
|
||||
}
|
||||
|
||||
glyphIterator->setCurrStreamPosition(position);
|
||||
|
|
|
@ -58,6 +58,25 @@ GlyphIterator::GlyphIterator(GlyphIterator &that)
|
|||
markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
|
||||
}
|
||||
|
||||
GlyphIterator::GlyphIterator(GlyphIterator &that, LETag newFeatureTag)
|
||||
{
|
||||
direction = that.direction;
|
||||
position = that.position;
|
||||
nextLimit = that.nextLimit;
|
||||
prevLimit = that.prevLimit;
|
||||
|
||||
cursiveFirstPosition = that.cursiveFirstPosition;
|
||||
cursiveLastPosition = that.cursiveLastPosition;
|
||||
|
||||
glyphs = that.glyphs;
|
||||
glyphPositionAdjustments = that.glyphPositionAdjustments;
|
||||
lookupFlags = that.lookupFlags;
|
||||
featureTag = newFeatureTag;
|
||||
glyphTags = that.glyphTags;
|
||||
glyphClassDefinitionTable = that.glyphClassDefinitionTable;
|
||||
markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
|
||||
}
|
||||
|
||||
GlyphIterator::GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags)
|
||||
{
|
||||
direction = that.direction;
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
|
||||
GlyphIterator(GlyphIterator &that);
|
||||
|
||||
GlyphIterator(GlyphIterator &that, LETag newFeatureTag);
|
||||
|
||||
GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags);
|
||||
|
||||
~GlyphIterator();
|
||||
|
|
Loading…
Add table
Reference in a new issue