X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a02f84b9467069a17055dd96c88ba9ab5ca9127..d730bd8a68c9e19fc3e2be13777ae267408a3833:/src/common/dcbase.cpp diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 33586d4629..a60da2e657 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -300,12 +300,12 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& data) { } -wxRect wxPrinterDC::GetPaperRect() +wxRect wxPrinterDC::GetPaperRect() const { return GetImpl()->GetPaperRect(); } -int wxPrinterDC::GetResolution() +int wxPrinterDC::GetResolution() const { return GetImpl()->GetResolution(); } @@ -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; +}