Index: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
diff --git a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
index af44f81aff09ab80c085da185a88c80f29146b06..41934b20cb7595f97b3d1470e1b7d6cf37aa2f3b 100644 |
--- a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
+++ b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
@@ -186,9 +186,24 @@ 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 |
leviw_travelin_and_unemployed
2014/02/10 00:10:38
I'm not sure I understand this TODO. Can you make
|
+ shaper.setDrawRange(from, to); |
+ shaper.shape(&glyphBuffer); |
+ return 0; |
} |
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const |