-#if 0
-    HDC dc = ::GetDC(NULL);
-    int ppInch = ::GetDeviceCaps(dc, LOGPIXELSY);
-    ::ReleaseDC(NULL, dc);
-#else
-    // New behaviour: apparently ppInch varies according to Large/Small Fonts
-    // setting in Windows. This messes up fonts. So, set ppInch to a constant
-    // 96 dpi.
-    static const int ppInch = 96;
-#endif // 0/1
-
-#if wxFONT_SIZE_COMPATIBILITY
-    // Incorrect, but compatible with old wxWindows behaviour
-    int nHeight = (font->GetPointSize()*ppInch/72);
-#else
-    // Correct for Windows compatibility
-    int nHeight = - (font->GetPointSize()*ppInch/72);
-#endif
+    switch (pFont->GetStyle())
+    {
+        case wxITALIC:
+        case wxSLANT:
+            nItalic = FTYPE_ITALIC;
+            pLogFont->fsSelection |= FATTR_SEL_ITALIC;
+            break;
+
+        default:
+            wxFAIL_MSG(wxT("unknown font slant"));
+            // fall through
+
+        case wxNORMAL:
+            nItalic = 0;
+            break;
+    }
+    pFaceName->flOptions |= nItalic;
+    if(pFont->GetUnderlined())
+        pLogFont->fsSelection |= FATTR_SEL_UNDERSCORE;
+
+    //
+    // In PM a font's height is expressed in points.  A point equals
+    // approximately 1/72 of an inch.  We'll assume for now that,
+    // like Windows, that fonts are 96 dpi.
+    //
+    DEVOPENSTRUC                    vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
+    HDC                             hDC = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE);
+    LONG                            lStart = CAPS_FAMILY;
+    LONG                            lCount = CAPS_VERTICAL_RESOLUTION;
+    LONG                            alArray[CAPS_VERTICAL_RESOLUTION];
+    LONG                            lRes;
+    int                             nPpInch;
+
+
+    ::DevQueryCaps(hDC, lStart, lCount, alArray);
+    lRes = alArray[CAPS_VERTICAL_RESOLUTION-1];
+    if (lRes > 0)
+        nPpInch = (int)(lRes/39.6); // lres is in pixels per meter
+    else
+        nPpInch = 96;
+
+    int                             nHeight = (pFont->GetPointSize() * nPpInch/72);
+    wxString                        sFacename = pFont->GetFaceName();