Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Font Size Algorithm
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Font Size Algorithm
Miscellaneous
Thread ID:
00965827
Message ID:
00965827
Views:
55
I was wondering if anyone knows of an equation that, given any width and height area, as well as a fontname, returns the appropiate size of a font to fill that area the best (I know it won't be perfect). Let's say I have a rectangle of 200w x 100h pixels, I want to fill it with the word 'Hello', I would need to set the fontsize to 66 if the font is Arial, so... how do I get that 66? Is there any equation I can use (I know I can do a loop thru all font sizes until I get the desired (best fit) size, but I want to use that iteration as a last workaround

TIA
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Next
Reply
Map
View

Click here to load this message in the networking platform