From 7a1d35a4877726511f73fc2dc2b3f301224a4cfb Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 11 Jun 2020 11:45:38 +1000 Subject: Bug [#2185]. Fix printing to use correct text size. --- win32/PlatWin.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index ad9bc78d1..b474c4552 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -615,7 +615,9 @@ void SurfaceGDI::Init(SurfaceID sid, WindowID wid) { Release(); hdc = static_cast(sid); ::SetTextAlign(hdc, TA_BASELINE); - logPixelsY = DpiForWindow(wid); + // Windows on screen are scaled but printers are not. + const bool printing = ::GetDeviceCaps(hdc, TECHNOLOGY) != DT_RASDISPLAY; + logPixelsY = printing ? ::GetDeviceCaps(hdc, LOGPIXELSY) : DpiForWindow(wid); } void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID wid) { -- cgit v1.2.3