wxGTK: Fixed printing to use fonts sizes adjustment consistent with wxMSW. In

particular, screen resolution no longer affects text size in printed output
when using wx's map-screen-to-paper approach to printing.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-09-28 09:33:04 +00:00
parent 988729f50a
commit 12ca55868c
5 changed files with 114 additions and 100 deletions

View File

@@ -1648,3 +1648,15 @@ void wxDCImpl::CalculateEllipticPoints( wxPointList* points,
} // CalculateEllipticPoints
#endif // __WXWINCE__
float wxDCImpl::GetFontPointSizeAdjustment(float dpi)
{
// wxMSW has long-standing bug where wxFont point size is interpreted as
// "pixel size corresponding to given point size *on screen*". In other
// words, on a typical 600dpi printer and a typical 96dpi screen, fonts
// are ~6 times smaller when printing. Unfortunately, this bug is so severe
// that *all* printing code has to account for it and consequently, other
// ports need to emulate this bug too:
const wxSize screenPPI = wxGetDisplayPPI();
return float(screenPPI.y) / dpi;
}