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

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 trybots 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..7cee5e06d096b436a7ad7ada42bd34dd78912804 100644
--- a/ui/gfx/platform_font.h
+++ b/ui/gfx/platform_font.h
@@ -52,6 +52,10 @@ class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> {
// string.
virtual int GetStringWidth(const base::string16& text) const = 0;
+ // Returns the pixel width needed to display the specified string. Note that
+ // the fractional width might be returned in some platforms.
+ virtual float GetStringWidthF(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.

Powered by Google App Engine
This is Rietveld 408576698