Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp

Issue 130433006: Implement CSS Emphasis Marks for complex text (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: countGraphemesInCluster based on m_normalizedBuffer (win build fix) Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/emphasis-complex.html ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..37dd7b2950d467d6b64f0064036b89ddef1edac7 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, HarfBuzzShaper::ForTextEmphasis);
+ shaper.setDrawRange(from, to);
+ shaper.shape(&glyphBuffer);
+ return 0;
}
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
« no previous file with comments | « LayoutTests/fast/text/emphasis-complex.html ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698