General information
Category:
Forms & Form designer
Claudio
1) Thanks, I had missed the point about Foxels.
2) The point about the lowercase is obvious. I was just wasn't clear that txtwidth() and fontmetric() were using 2 different units of measurement.
3) Thanks for checking the typeo's.
Tevye
>>With an Arial font, 10 pitch I get
>>txtwidth('ABCDEFGHIJKLMNOPQRSTUVWZYZ0123456789')/26 = 1.891
>>txtwidth('abcdefghijklmnopqrstuvwxyz01234567890')/26 = 1.4423
>>But fontmetric(6) = 6
>
>The numbers look OK to me. txtwidth() returns a value in 'foxel's. fontmetric() returns a value in pixels (i.e. the average char will be 6 pixels wide). The reason that your txtwidth() values are much greater than 1 char is that you should be dividing by 36 (because of the digits), not 26. Your example with uppercase letters is also missing a '0' (zero). Finally, the reason that the lowercase string has 'thinner' (for lack of a better description) char widths is because Arial is a proportional font and lowercase letters tend to me shorter in width than their uppercase equivalents.
>
>Thanks again for your help!
>Malcolm
>
>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only