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

Unified Diff: ui/gfx/text_utils.h

Issue 22835002: Supports gfx::FontList in gfx::Canvas and ui::ElideText family. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: layout_text.h => text_utils.h Created 7 years, 4 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
« no previous file with comments | « ui/gfx/canvas_skia.cc ('k') | ui/gfx/text_utils_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_utils.h
diff --git a/ui/gfx/text_utils.h b/ui/gfx/text_utils.h
index 42bce4397316966d33565ff84408996ece8cec87..15bf3cadfbb4291197f09828116a9b25af9d5b6e 100644
--- a/ui/gfx/text_utils.h
+++ b/ui/gfx/text_utils.h
@@ -10,6 +10,8 @@
namespace gfx {
+class FontList;
+
// Strip the accelerator char (typically '&') from a menu string. A double
// accelerator char ('&&') will be converted to a single char. The out params
// |accelerated_char_pos| and |accelerated_char_span| will be set to the index
@@ -20,6 +22,11 @@ UI_EXPORT base::string16 RemoveAcceleratorChar(const base::string16& s,
int* accelerated_char_pos,
int* accelerated_char_span);
+// Returns the number of horizontal pixels needed to display the specified
+// |text| with |font_list|.
+UI_EXPORT int GetStringWidth(const base::string16& text,
+ const FontList& font_list);
+
} // namespace gfx
#endif // UI_GFX_TEXT_UTILS_H_
« no previous file with comments | « ui/gfx/canvas_skia.cc ('k') | ui/gfx/text_utils_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698