aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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 2338f4ece..1b0697810 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -586,6 +586,10 @@
<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>
+ <li>
Fixed bug in Batch lexer where a single character line with a single character line end continued
state onto the next line.
</li>
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 42b1dae53..11dc5d3ed 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -616,7 +616,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) {