Index: Source/platform/fonts/Font.cpp |
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp |
index 4aa7fec065308bc18e9da16e69cc689bc7857f63..03bcf14f77afc0846a860bcdd7bb81673a4dbf3d 100644 |
--- a/Source/platform/fonts/Font.cpp |
+++ b/Source/platform/fonts/Font.cpp |
@@ -703,9 +703,9 @@ inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, Glyph |
return fontData->widthForGlyph(glyph) / 2; |
} |
-inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer, size_t i) |
+inline static float offsetToMiddleOfAdvanceAtIndex(const GlyphBuffer& glyphBuffer, size_t i) |
{ |
- return offsetToMiddleOfGlyph(glyphBuffer.fontDataAt(i), glyphBuffer.glyphAt(i)); |
+ return glyphBuffer.advanceAt(i) / 2; |
} |
void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const |
@@ -724,12 +724,12 @@ void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& r |
Glyph markGlyph = markGlyphData.glyph; |
Glyph spaceGlyph = markFontData->spaceGlyph(); |
- float middleOfLastGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, 0); |
+ float middleOfLastGlyph = offsetToMiddleOfAdvanceAtIndex(glyphBuffer, 0); |
FloatPoint startPoint(point.x() + middleOfLastGlyph - offsetToMiddleOfGlyph(markFontData, markGlyph), point.y()); |
GlyphBuffer markBuffer; |
for (unsigned i = 0; i + 1 < glyphBuffer.size(); ++i) { |
- float middleOfNextGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, i + 1); |
+ float middleOfNextGlyph = offsetToMiddleOfAdvanceAtIndex(glyphBuffer, i + 1); |
float advance = glyphBuffer.advanceAt(i) - middleOfLastGlyph + middleOfNextGlyph; |
markBuffer.add(glyphBuffer.glyphAt(i) ? markGlyph : spaceGlyph, markFontData, advance); |
middleOfLastGlyph = middleOfNextGlyph; |