Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Font Size Algorithm
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Font Size Algorithm
Divers
Thread ID:
00965827
Message ID:
00965827
Vues:
53
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform