aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-06-11 11:45:38 +1000
committerNeil <nyamatongwe@gmail.com>2020-06-11 11:45:38 +1000
commit7a1d35a4877726511f73fc2dc2b3f301224a4cfb (patch)
tree6cb30b1859bff152d3d9cc1c4594425f18300cea
parenta2931677c6e28aad5ddd56d82e5a8814746dc5fd (diff)
downloadscintilla-mirror-7a1d35a4877726511f73fc2dc2b3f301224a4cfb.tar.gz
Bug [#2185]. Fix printing to use correct text size.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--win32/PlatWin.cxx4
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index fc698298c..f27c4c1cb 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -582,6 +582,10 @@
elements to match text.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1355/">Feature #1355</a>.
</li>
+ <li>
+ Fix printing on Windows to use correct text size.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2185/">Bug #2185</a>.
+ </li>
</ul>
<h3>
<a href="https://www.scintilla.org/scite443.zip">Release 4.4.3</a>
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<HDC>(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) {