]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
Some doc corrections
[wxWidgets.git] / src / msw / font.cpp
index c4392218bdfd8a7fbf3646c8a131d18dc03f6942..39f7d08a7e515d3cbdb8592cf2506f73e76e4942 100644 (file)
@@ -218,16 +218,10 @@ void wxFontRefData::Init(const wxNativeFontInfo& info)
 
     m_faceName = info.lf.lfFaceName;
 
-    // remember that 1pt = 1/72inch
     int height = abs(info.lf.lfHeight);
 
-#if wxUSE_SCREEN_DPI
-    HDC dc = ::GetDC(NULL);
-    static const int ppInch = GetDeviceCaps(dc, LOGPIXELSY);
-    ::ReleaseDC(NULL, dc);
-#else
-    static const int ppInch = 96;
-#endif
+    // remember that 1pt = 1/72inch
+    const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
     m_pointSize = (int) (((72.0*((double)height))/(double) ppInch) + 0.5);
 
     m_encoding = wxGetFontEncFromCharSet(info.lf.lfCharSet);