How to get the Font size for TGet?

How to get the Font size for TGet?

Postby dutch » Fri Dec 21, 2007 2:41 pm

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
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby Detlef Hoefner » Fri Dec 21, 2007 3:03 pm

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  Expand view
GetTextWidth( <hDC>, <cString>, [<hFont>] )  --> <nPixelWidth>
May be that could help you.

Best regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 87 guests