If you're used to specifying your font sizes in pixels, you may need the following small function for use with the new FONT NEW statement, which accepts only point heights.
Although the FONT NEW help seems to imply that the fontname$ parameter is obligatory, it seems happy to accept a null string here with an appropriate font family code in the pitch& parameter.
Code:
function PixelsToPoints (Pixls as long) as single local hDC as dword local PixPerInchY as long hDC = GetDC(%HWND_DESKTOP) PixPerInchY = GetDeviceCaps(hDC, %LOGPIXELSY) ReleaseDC %HWND_DESKTOP, hDC PixelsToPoints = 72 * Pixls / PixPerInchY end function
Comment