Use fixed screen DPI of 96 when printing HTML.

Unlike font sizes, which depend on screen resolution because of weird
wxFont API, pixel sizes used elsewhere (and in particular, for images)
shouldn't depend on screen DPI.

This finally makes the output independent of screen size.

Fixes #10942.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-03-29 14:19:06 +00:00
parent 5a21001cdd
commit c44a49b852
4 changed files with 50 additions and 10 deletions

View File

@@ -552,6 +552,13 @@ void wxHtmlWinParser::SetFontSize(int s)
}
void wxHtmlWinParser::SetDC(wxDC *dc, double pixel_scale, double font_scale)
{
m_DC = dc;
m_PixelScale = pixel_scale;
m_FontScale = font_scale;
}
wxFont* wxHtmlWinParser::CreateCurrentFont()
{
@@ -582,7 +589,7 @@ wxFont* wxHtmlWinParser::CreateCurrentFont()
{
*faceptr = face;
*fontptr = new wxFont(
(int) (m_FontsSizes[fs] * m_PixelScale),
(int) (m_FontsSizes[fs] * m_FontScale),
ff ? wxMODERN : wxSWISS,
fi ? wxITALIC : wxNORMAL,
fb ? wxBOLD : wxNORMAL,