01-30-2009 04:40 AM
01-30-2009 09:01 AM
Hi,
I also know of no better way than using GetTextDisplaySize with a given metafont. I have a similar routine where I generate short path names that fit into a given text control width, and I am using this function to calculate the width of the text. For numbers, of course, it will depend on the formatting...
BUT, if you know your font in advance, say Arial, you can find out manually. This is the way I did it. For Arial, a minus sign is 5 pixels, a dot 3, and the exponent takes 22, for a digit 7 pixels are required. ... sorry if it's not a better suggestion.
Wolfgang