From a2d22f8b93c1aed36c038ddc58dc420f2cb771b3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 25 Feb 2014 17:26:48 +0000 Subject: [PATCH] Fix font size when using wxGraphicsContext with wxPrinterDC in wxMSW. Use pixel size which is scaled correctly by GDI+ itself instead of the size in points which is currently not scaled correctly by wx. Closes #3566. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 802469f875..f6a456b178 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -946,7 +946,9 @@ wxGDIPlusFontData::wxGDIPlusFontData( wxGraphicsRenderer* renderer, if ( font.GetWeight() == wxFONTWEIGHT_BOLD ) style |= FontStyleBold; - Init(font.GetFaceName(), font.GetPointSize(), style, col, UnitPoint); + // Create font which size is measured in logical units + // and let the system rescale it according to the target resolution. + Init(font.GetFaceName(), font.GetPixelSize().GetHeight(), style, col, UnitPixel); } wxGDIPlusFontData::wxGDIPlusFontData(wxGraphicsRenderer* renderer,