Page 1 of 1

How to get the Font size for TGet?

Posted: Fri Dec 21, 2007 2:41 pm
by dutch
Dear All,

I would like to set TGet length (Pixel) match with Font Size?

Because the user can define Font Size, the Variable digit set by user.

How can I get it?

Regards,
Dutch

Posted: Fri Dec 21, 2007 3:03 pm
by Detlef Hoefner
Dutch,

this is a rather difficult procedure.
Unlike to MS DOS console programs with their fix font size for each letter and digit in Windows you must be aware of proportional width of characters.

To be sure you could take n times to width of the biggest character, i think it's a 'W'.
This value you can get from

Code: Select all

GetTextWidth( <hDC>, <cString>, [<hFont>] )  --> <nPixelWidth> 
May be that could help you.

Best regards,
Detlef