diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 16:22:56 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 16:22:56 +0000 |
commit | a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7 (patch) | |
tree | e6bc10d56eac0b942b3e0c05e11a5d01614c2306 /chrome/common | |
parent | f1c7411610f2f849f74eb8d911665e607657a028 (diff) | |
download | chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.zip chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.tar.gz chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.tar.bz2 |
Fix Issue 2918 in chromium: Chrome dialog displayed in large size with Meiryo font.This issue is caused by a font whose text metric |tmAveCharWidth| is not precise as noted in Microsoft Knowledge Base 145994 (*1) To handle this case, this change uses the ChromeFont::horizontal_dlus_to_pixels() function instead of the ChromeFont::ave_char_width() function.(*1) http://support.microsoft.com/kb/145994BUG=2918
Review URL: http://codereview.chromium.org/8051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4213 0039d316-1c4b-4281-b951-d872f2087c98
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(); } |