Ticket #6113: MarkToBasePosnSubtables.cpp.patch

File MarkToBasePosnSubtables.cpp.patch, 1.8 kB (added by jonathan_kew@..., 1 year ago)

patch for MarkToBasePosnSubtables.cpp providing *partial* fix for 6113

  • ../../../libs/icu-release-3-6-source/layout/MarkToBasePosnSubtables.cpp

    old new  
    8383    glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); 
    8484 
    8585    if (glyphIterator->isRightToLeft()) { 
     86        ///// FIXME: need similar patch to below; also in MarkToLigature and MarkToMark 
     87        ///// (is there a better way to approach this for all the cases?) 
    8688        glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); 
    8789    } else { 
    8890        LEPoint baseAdvance; 
    8991 
    9092        fontInstance->getGlyphAdvance(baseGlyph, pixels); 
     93         
     94        ///// JK: adjustment needs to account for non-zero advance of any marks between base glyph and current mark 
     95        GlyphIterator gi(baseIterator, (le_uint16)0); // copy of baseIterator that won't ignore marks 
     96        gi.next(); // point beyond the base glyph 
     97        while (gi.getCurrStreamPosition() < glyphIterator->getCurrStreamPosition()) { // for all intervening glyphs (marks)... 
     98                LEGlyphID otherMark = gi.getCurrGlyphID(); 
     99                LEPoint px; 
     100                fontInstance->getGlyphAdvance(otherMark, px); // get advance, in case it's non-zero 
     101                pixels.fX += px.fX; // and add that to the base glyph's advance 
     102                pixels.fY += px.fY; 
     103                gi.next(); 
     104        } 
     105        ///// end of JK patch 
     106         
    91107        fontInstance->pixelsToUnits(pixels, baseAdvance); 
    92108 
    93109        glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY);