summaryrefslogtreecommitdiffstats
path: root/cc/font_atlas.h
diff options
context:
space:
mode:
Diffstat (limited to 'cc/font_atlas.h')
-rw-r--r--cc/font_atlas.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/font_atlas.h b/cc/font_atlas.h
index 24592e4..d18483f 100644
--- a/cc/font_atlas.h
+++ b/cc/font_atlas.h
@@ -31,6 +31,9 @@ public:
}
~FontAtlas();
+ // Current font height.
+ int fontHeight() const { return m_fontHeight; }
+
// Draws multiple lines of text where each line of text is separated by '\n'.
// - Correct glyphs will be drawn for ASCII codes in the range 32-127; any characters
// outside that range will be displayed as a default rectangle glyph.
@@ -39,6 +42,9 @@ public:
// - Should only be called only on the impl thread.
void drawText(SkCanvas*, const SkPaint&, const std::string& text, const gfx::Point& destPosition, const gfx::Size& clip) const;
+ // Gives a text's width and height on the canvas.
+ gfx::Size textSize(const std::string& text);
+
// Draws the entire atlas at the specified position, just for debugging purposes.
void drawDebugAtlas(SkCanvas*, const gfx::Point& destPosition) const;