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

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: 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/font.h
diff --git a/ui/gfx/font.h b/ui/gfx/font.h
index 020ab64f744e1d807aaa404ddbf6bc046d218f3a..398eda363770b75a5d292a8170be4acbe2bc4408 100644
--- a/ui/gfx/font.h
+++ b/ui/gfx/font.h
@@ -79,6 +79,10 @@ class GFX_EXPORT Font {
// string.
int GetStringWidth(const base::string16& text) const;
+ // Returns the pixel width needed to display the specified string. Note that
+ // the fractional width might be returned in some platforms.
+ float GetStringWidthF(const base::string16& text) const;
Alexei Svitkine (slow) 2013/10/07 21:43:39 Is this actually needed? Does someone need to use
jianli 2013/10/07 23:18:45 Done.
+
// Returns the expected number of horizontal pixels needed to display the
// specified length of characters. Call GetStringWidth() to retrieve the
// actual number.
« no previous file with comments | « ui/gfx/canvas_unittest_mac.mm ('k') | ui/gfx/font.cc » ('j') | ui/gfx/font_list.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698