Index: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
diff --git a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
index f4ffeb69c837e033630dc02acf4eb50d54b1cb16..a9eca7e6a046ab5cf1a0d1731e9d4d3cb33eabb0 100644 |
--- a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
+++ b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
@@ -185,9 +185,27 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRunPaintInfo& runInfo, |
drawGlyphBuffer(gc, runInfo, glyphBuffer, adjustedPoint); |
} |
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const |
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const |
{ |
- notImplemented(); |
+ GlyphBuffer glyphBuffer; |
+ |
+ float initialAdvance = getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis); |
+ |
+ if (glyphBuffer.isEmpty()) |
+ return; |
+ |
+ drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y())); |
+} |
+ |
+float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const |
+{ |
+ HarfBuzzShaper shaper(this, run, ForTextEmphasis); // TODO: forTextEmphasis argument? Nullify space & separator glyphs |
+ shaper.setDrawRange(from, to); |
+ if (!shaper.shape(&glyphBuffer)) |
+ return 0; |
+ |
+ // TODO: rtl()? Get this initial value? |
+ return 0; |
} |
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const |