+void wxConvertVectorFontSize(
+ FIXED fxPointSize
+, PFATTRS pFattrs
+)
+{
+ 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.
+ //
+
+ vSizef.cx = (FIXED)(((fxPointSize) / 72 ) * lXFontResolution );
+ vSizef.cy = (FIXED)(((fxPointSize) / 72 ) * lYFontResolution );
+
+ pFattrs->lMaxBaselineExt = MAKELONG( HIUSHORT( vSizef.cy ), 0 );
+ pFattrs->lAveCharWidth = MAKELONG( HIUSHORT( vSizef.cx ), 0 );
+ WinReleasePS(hPS);
+
+} // end of wxConvertVectorPointSize
+