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

Unified Diff: ui/gfx/font.h

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes per feedback Created 7 years, 3 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: ui/gfx/font.h
diff --git a/ui/gfx/font.h b/ui/gfx/font.h
index 020ab64f744e1d807aaa404ddbf6bc046d218f3a..9365223d084c9047e8aef37279529a5ffe653195 100644
--- a/ui/gfx/font.h
+++ b/ui/gfx/font.h
@@ -72,17 +72,15 @@ class GFX_EXPORT Font {
// Returns the cap height of the font.
int GetCapHeight() const;
- // Returns the average character width for the font.
- int GetAverageCharacterWidth() const;
+ // Returns the pixel width of an average character for the font.
+ float GetAverageCharacterWidth() const;
- // Returns the number of horizontal pixels needed to display the specified
- // string.
- int GetStringWidth(const base::string16& text) const;
+ // Returns the pixel width needed to display the specified string.
+ float GetStringWidth(const base::string16& text) const;
- // Returns the expected number of horizontal pixels needed to display the
- // specified length of characters. Call GetStringWidth() to retrieve the
- // actual number.
- int GetExpectedTextWidth(int length) const;
+ // Returns the expected pixel width needed to display the specified length of
+ // characters. Call GetStringWidth() to retrieve the actual number.
+ float GetExpectedTextWidth(int length) const;
// Returns the style of the font.
int GetStyle() const;

Powered by Google App Engine
This is Rietveld 408576698