Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determing form size necessary to display arbitrary text
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00575284
Message ID:
00577148
Views:
34
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
Map
View

Click here to load this message in the networking platform