Index: ui/gfx/canvas.h |
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h |
index 9aa7a0a4e4d6cc126b000520ea9bbca9afcd91f3..438a21ae34986bdcfa883c73d1c1a309fd87c43d 100644 |
--- a/ui/gfx/canvas.h |
+++ b/ui/gfx/canvas.h |
@@ -139,6 +139,14 @@ class GFX_EXPORT Canvas { |
int line_height, |
int flags); |
+ // This is same as SizeStringInt except that fractional size is returned. |
+ static void SizeStringFloat(const base::string16& text, |
+ const FontList& font_list, |
+ float* width, |
+ float* height, |
+ int line_height, |
+ int flags); |
+ |
// Returns the number of horizontal pixels needed to display the specified |
// |text| with |font_list|. |
static int GetStringWidth(const base::string16& text, |
@@ -146,6 +154,12 @@ class GFX_EXPORT Canvas { |
// Obsolete version. Use the above version which takes FontList. |
static int GetStringWidth(const base::string16& text, const Font& font); |
+ // Returns the pixel width needed to display the specified |text| with |
+ // |font_list|. Note that the fractional width might be returned in some |
Alexei Svitkine (slow)
2013/10/07 23:33:28
Maybe mention explicitly which ones like the rende
jianli
2013/10/08 00:01:18
Done.
|
+ // platforms. |
+ static float GetStringWidthF(const base::string16& text, |
+ const FontList& font_list); |
+ |
// Returns the default text alignment to be used when drawing text on a |
// Canvas based on the directionality of the system locale language. |
// This function is used by Canvas::DrawStringInt when the text alignment |