+ HPS hPS;
+ HDC hDC;
+ LONG lXFontResolution;
+ LONG lYFontResolution;
+ SIZEF vSizef;
+
+ hPS = WinGetScreenPS(HWND_DESKTOP); // Screen presentation space
+
+ //
+ // Query device context for the screen and then query
+ // the resolution of the device for the device context.
+ //
+
+ hDC = GpiQueryDevice(hPS);
+ DevQueryCaps( hDC, CAPS_HORIZONTAL_FONT_RES, (LONG)1, &lXFontResolution);
+ DevQueryCaps( hDC, CAPS_VERTICAL_FONT_RES, (LONG)1, &lYFontResolution);
+
+ //
+ // Calculate the size of the character box, based on the
+ // point size selected and the resolution of the device.
+ // The size parameters are of type FIXED, NOT int.
+ // NOTE: 1 point == 1/72 of an inch.
+ //
+
+ // multiply first to avoid getting vSizef.cx,cy = 0 since fxPointSize
+ // is normally < 72 and FontResolution is typically ca. 100
+ vSizef.cx = (FIXED)( (fxPointSize * lXFontResolution) / 72 );
+ vSizef.cy = (FIXED)( (fxPointSize * lYFontResolution) / 72 );
+
+ if (pFattrs)
+ {
+ pFattrs->lMaxBaselineExt = MAKELONG( HIUSHORT( vSizef.cy ), 0 );
+ pFattrs->lAveCharWidth = MAKELONG( HIUSHORT( vSizef.cx ), 0 );
+ }
+ WinReleasePS(hPS);
+
+} // end of wxConvertVectorPointSize
+
+void wxFillLogFont( LOGFONT* pFattrs, // OS2 GPI FATTRS
+ PFACENAMEDESC pFaceName,
+ HPS* phPS,
+ bool* pbInternalPS,
+ long* pflId,
+ wxString& sFaceName,
+ wxFont* pFont )
+{
+ LONG lNumFonts = 0L; // For system font count
+ ERRORID vError; // For logging API errors
+ LONG lTemp = 0L;
+ bool bInternalPS = false; // if we have to create one
+ PFONTMETRICS pFM = NULL;