Work-around Windows 8 bug causing print footers and headers to have incorrect size.

This change causes the code to take a different HFONT creation path, which doesn't exhibit the issue.

BUG=139206
TEST=Launch print preview under Windows 8 (desktop mode is fine). Print headers and footers shouldn't have a ridiculously large font size.

Review URL: https://chromiumcodereview.appspot.com/10837080

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150207 0039d316-1c4b-4281-b951-d872f2087c98
parent d43d2e11
...@@ -443,8 +443,13 @@ void PrintHeaderFooterText( ...@@ -443,8 +443,13 @@ void PrintHeaderFooterText(
horizontal_position, horizontal_position,
vertical_position, offset_to_baseline, vertical_position, offset_to_baseline,
text_width_in_points); text_width_in_points);
paint->SetFontSize(printing::kSettingHeaderFooterFontSize / // Set the scaled font size before drawing the text.
webkit_scale_factor); // This creates a new font instead of calling |paint->SetFontSize()| to work
// around a Windows 8 bug. See: http://crbug.com/139206
gfx::FontList font_list(
gfx::Font(printing::kSettingHeaderFooterFontFamilyName,
printing::kSettingHeaderFooterFontSize / webkit_scale_factor));
paint->SetFontList(font_list);
gfx::Size size(paint->GetStringSize()); gfx::Size size(paint->GetStringSize());
gfx::Rect rect(point.x(), point.y() - paint->GetBaseline(), gfx::Rect rect(point.x(), point.y() - paint->GetBaseline(),
size.width(), size.height()); size.width(), size.height());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment