The font height and Font size (Point size) are not the same thing.
Here is how you calculate the Font height using a Font Point Size :
Code:
FUNCTION FontHeight(BYVAL PointSize&) AS LONG hDC = GetDC(%HWND_DESKTOP) V&=GetDeviceCaps(hDC, %LOGPIXELSY) ReleaseDC %HWND_DESKTOP, hDC FUNCTION=-MulDiv(PointSize&, V&, 72) END FUNCTION
on a Point size. By using GetDeviceCaps the font will be autosized
based on the end users system wide font setting (Small Fonts/ Large Fonts).
Microsoft recommends using the MulDiv function (API) to get the right
size.
------------------
Leave a comment: