106 float anchorDiffY = baseAnchor.fY - markAnchor.fY; |
106 float anchorDiffY = baseAnchor.fY - markAnchor.fY; |
107 |
107 |
108 glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); |
108 glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); |
109 |
109 |
110 if (glyphIterator->isRightToLeft()) { |
110 if (glyphIterator->isRightToLeft()) { |
|
111 // FIXME: need similar patch to below; also in MarkToLigature and MarkToMark |
|
112 // (is there a better way to approach this for all the cases?) |
111 glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); |
113 glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); |
112 } else { |
114 } else { |
113 LEPoint baseAdvance; |
115 LEPoint baseAdvance; |
114 |
116 |
115 fontInstance->getGlyphAdvance(baseGlyph, pixels); |
117 fontInstance->getGlyphAdvance(baseGlyph, pixels); |
|
118 |
|
119 //JK: adjustment needs to account for non-zero advance of any marks between base glyph and current mark |
|
120 GlyphIterator gi(baseIterator, (le_uint16)0); // copy of baseIterator that won't ignore marks |
|
121 gi.next(); // point beyond the base glyph |
|
122 while (gi.getCurrStreamPosition() < glyphIterator->getCurrStreamPosition()) { // for all intervening glyphs (marks)... |
|
123 LEGlyphID otherMark = gi.getCurrGlyphID(); |
|
124 LEPoint px; |
|
125 fontInstance->getGlyphAdvance(otherMark, px); // get advance, in case it's non-zero |
|
126 pixels.fX += px.fX; // and add that to the base glyph's advance |
|
127 pixels.fY += px.fY; |
|
128 gi.next(); |
|
129 } |
|
130 // end of JK patch |
|
131 |
116 fontInstance->pixelsToUnits(pixels, baseAdvance); |
132 fontInstance->pixelsToUnits(pixels, baseAdvance); |
117 |
133 |
118 glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); |
134 glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); |
119 } |
135 } |
120 |
136 |