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

Unified Diff: ui/gfx/platform_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: Fix round-down problems Created 7 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: ui/gfx/platform_font.h
diff --git a/ui/gfx/platform_font.h b/ui/gfx/platform_font.h
index d576bcdf06b3b0e8a4bf8405ab1059eadbeee293..a07a7e2672340c8d1ec9a53473795c605728044c 100644
--- a/ui/gfx/platform_font.h
+++ b/ui/gfx/platform_font.h
@@ -45,17 +45,15 @@ class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> {
// Returns the cap height of the font.
virtual int GetCapHeight() const = 0;
- // Returns the average character width for the font.
- virtual int GetAverageCharacterWidth() const = 0;
+ // Returns the pixel width of an average character for the font.
+ virtual float GetAverageCharacterWidth() const = 0;
- // Returns the number of horizontal pixels needed to display the specified
- // string.
- virtual int GetStringWidth(const base::string16& text) const = 0;
+ // Returns the pixel width needed to display the specified string.
+ virtual float GetStringWidth(const base::string16& text) const = 0;
- // Returns the expected number of horizontal pixels needed to display the
- // specified length of characters. Call GetStringWidth() to retrieve the
- // actual number.
- virtual int GetExpectedTextWidth(int length) const = 0;
+ // Returns the expected pixel width needed to display the specified length of
+ // characters. Call GetStringWidth() to retrieve the actual number.
+ virtual float GetExpectedTextWidth(int length) const = 0;
// Returns the style of the font.
virtual int GetStyle() const = 0;
« ui/gfx/canvas.h ('K') | « ui/gfx/font_unittest.cc ('k') | ui/gfx/platform_font_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698