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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.h

Issue 2416603002: Add ability to compute text intercepts to Font (Closed)
Patch Set: Addressing fmalita's review comments Created 4 years, 2 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
Index: third_party/WebKit/Source/platform/fonts/Font.h
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h
index bff7ab2b0ded9a9ba7b53770ea2e1d11a38d1433..403c6fe5022bdd3343e0e5405242a9cd8f791415 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -101,6 +101,23 @@ class PLATFORM_EXPORT Font {
float deviceScaleFactor,
const SkPaint&) const;
+ struct TextIntercept {
+ float m_begin, m_end;
+ };
+
+ // Compute the text intercepts along the axis of the advance and write them
+ // into the specified Vector of TextIntercepts. The number of those is zero or
+ // a multiple of two, and is at most the number of glyphs * 2 in the TextRun
+ // part of TextRunPaintInfo. Specify bounds for the upper and lower extend of
+ // a line crossing through the text, parallel to the baseline.
+ // TODO(drott): crbug.com/655154 Fix this for
+ // upright in vertical.
+ void getTextIntercepts(const TextRunPaintInfo&,
+ float deviceScaleFactor,
+ const SkPaint&,
+ const std::tuple<float, float>& bounds,
+ Vector<TextIntercept>&) const;
+
// Glyph bounds will be the minimum rect containing all glyph strokes, in
// coordinates using (<text run x position>, <baseline position>) as the
// origin.

Powered by Google App Engine
This is Rietveld 408576698