X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b062fade9feb1c14d9e26aba80a5098e107ea2a5..50e55c13ea2da06b1b03069673ae45edd780fc99:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4792c8de81..d62b8ab161 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -30,6 +30,7 @@ #include "wx/textctrl.h" #include "wx/settings.h" #include "wx/brush.h" + #include "wx/dcclient.h" #include "wx/utils.h" #include "wx/intl.h" #include "wx/log.h" @@ -2740,7 +2741,10 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) LOGFONT lf; - lf.lfHeight = cf.yHeight; + // Convert the height from the units of 1/20th of the point in which + // CHARFORMAT stores it to pixel-based units used by LOGFONT. + const wxCoord ppi = wxClientDC(this).GetPPI().y; + lf.lfHeight = -MulDiv(cf.yHeight/2, ppi, 72); lf.lfWidth = 0; lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset? lf.lfClipPrecision = 0;