diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gfx/chrome_font.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/common/gfx/chrome_font.h b/chrome/common/gfx/chrome_font.h index 77e48f6..2cfd28b 100644 --- a/chrome/common/gfx/chrome_font.h +++ b/chrome/common/gfx/chrome_font.h @@ -65,6 +65,13 @@ class ChromeFont { // string. int GetStringWidth(const std::wstring& text) const; + // Returns the expected number of horizontal pixels needed to display + // the specified length of characters. + // Call the GetStringWidth() function to retrieve the actual number. + int GetExpectedTextWidth(int length) const { + return length * font_ref_->dlu_base_x(); + } + // Returns the style of the font. int style() const { return font_ref_->style(); } |