Chromium Code Reviews| Index: ui/gfx/canvas.h |
| diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h |
| index 9aa7a0a4e4d6cc126b000520ea9bbca9afcd91f3..4646841e21e54f67215f1abc6491ef53d438afa9 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. |
|
sky
2013/10/08 02:12:56
Please add a comment here and any public API you'r
jianli
2013/10/08 18:29:48
Added comment in Canvas::GetStringWidthF. We do no
|
| + 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,10 @@ class GFX_EXPORT Canvas { |
| // Obsolete version. Use the above version which takes FontList. |
| static int GetStringWidth(const base::string16& text, const Font& font); |
| + // This is same as GetStringWidth except that fractional width is returned. |
| + 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 |