When you calculate the size for a Font you can convert a
"point" size into the Height value (first parameter) for the
CreateFont API function and also check the system for the
Systemwide Font setting (small fonts/large fonts) in the
calculation using the code below :
Code:
' ----------------------------- ' PointSize& - is the Point size of the font ' SF& - System wide font size factor ' ----------------------------- hDC = GetDC(%HWND_DESKTOP) SF&=GetDeviceCaps(hDC, %LOGPIXELSY) ReleaseDC %HWND_DESKTOP, hDC ' ----------------------------- ' FHeight& will be used as first paramter (height) ' in the CreateFont API function FHeight&=-MulDiv(PointSize&, SF&, 72)
for calculating a Fonts height. This will allow your fonts to
autoscale based on the end users font setting (small/large fonts).
------------------
Leave a comment: