From 90815a45979c7fcb463f2c4886f150d726d33d0c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Sep 2008 16:30:17 +0000 Subject: [PATCH] use wxGetDisplayPPI() instead of redoing it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/dfb/fontmgr.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/dfb/fontmgr.cpp b/src/dfb/fontmgr.cpp index 3913b995f8..28f954ac5c 100644 --- a/src/dfb/fontmgr.cpp +++ b/src/dfb/fontmgr.cpp @@ -17,6 +17,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/gdicmn.h" #include "wx/utils.h" #include "wx/log.h" #endif @@ -46,14 +47,10 @@ wxFontInstance::wxFontInstance(float ptSize, bool aa, const wxString& filename) : wxFontInstanceBase(ptSize, aa) { - int scrSizePx, scrSizeMM; - wxDisplaySize(NULL, &scrSizePx); - wxDisplaySizeMM(NULL, &scrSizeMM); - double dpi = (scrSizePx / (scrSizeMM * mm2inches)); // NB: DFB's fract_height value is 32bit integer with the last 6 bit // representing fractional value, hence the multiplication by 64; // 1pt=1/72inch, hence "/ 72" - int pixSize = int(ptSize * dpi * 64 / 72); + int pixSize = int(ptSize * wxGetDisplayPPI().y * 64 / 72); DFBFontDescription desc; desc.flags = (DFBFontDescriptionFlags)( -- 2.45.2