From a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7 Mon Sep 17 00:00:00 2001 From: "hbono@chromium.org" Date: Thu, 30 Oct 2008 16:22:56 +0000 Subject: 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 --- chrome/views/window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chrome/views/window.cc') diff --git a/chrome/views/window.cc b/chrome/views/window.cc index 0eaa599..1566584 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -251,7 +251,7 @@ gfx::Size Window::GetLocalizedContentsSize(int col_resource_id, double chars = _wtof(l10n_util::GetString(col_resource_id).c_str()); double lines = _wtof(l10n_util::GetString(row_resource_id).c_str()); - int width = static_cast(font.ave_char_width() * chars); + int width = font.GetExpectedTextWidth(static_cast(chars)); int height = static_cast(font.height() * lines); DCHECK(width > 0 && height > 0); -- cgit v1.1