How to get the Font size for TGet?

Post Reply
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

How to get the Font size for TGet?

Post 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
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post 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
Post Reply