Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Font and Field Size
Message
From
09/01/2001 14:19:33
 
 
To
09/01/2001 13:38:52
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00461331
Message ID:
00461356
Views:
12
Hi!

There is nice function - TxtWidth(). It allows to calculate the size of text by font and font size. For field, get the field size and replicate it with character that have average width:

TxtWidth(replicate('A',FieldSize),'Arial','12')

Above function returns required width for character fields. Of course, when you use 'W' instead of 'A', for most fonts above function will return larger number. For numeric fields replace 'A' by '8'.

There is also FONTMETRIC( ) function, you can give it a use too.

>hi, Can anyone help me with my little problem ....
>
> I'm doing a "Report Designer" and i need to know the size (height and width) to any field to a report field.
>
> The user can say the Font and Size, and the program automatic put the field in the correct size on the report.
>
>
>Nuno Brito
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform