Index: Source/platform/fonts/FontFastPath.cpp |
diff --git a/Source/platform/fonts/FontFastPath.cpp b/Source/platform/fonts/FontFastPath.cpp |
index 93e9015e08b1d050895e21ce0ccbc98aa6a53925..e8d24a55cace16e55607e64bbc6c7c8746246c06 100644 |
--- a/Source/platform/fonts/FontFastPath.cpp |
+++ b/Source/platform/fonts/FontFastPath.cpp |
@@ -498,9 +498,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 |
@@ -519,12 +519,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; |