Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any formula for resize font when resizing form?
Message
De
08/12/2009 12:14:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
08/12/2009 11:24:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01438061
Message ID:
01438079
Vues:
112
>Hi,
>
>Definitely an interesting issue. I'm interested as well by the return as well.
>
>Not being a math guy by education, I just established the font scaling by trial and error.
>
>What I discovered, however, that the resizing issue is getting even more tricky when it comes not only to one single font size but a couple of distinct font values, and even worse, a couple of distinct font sizes and font values. I systematically offer "automatic value" as a default choice with an option to a "manual setting".
>
>An effective formula would help:)

I tried that once, and I think VFE also had the code somewhere (in the resizer class), but it really is tricky. My solution was to preserve the original font size, and get the next font size proportionately , rounding to the nearest integer. The point here was to always compute against the original size as it was at design time, or else the rounding errors would crop up within just a few resizes and the whole thing would become a mess.

I had to do that for a couple of generated webpages (hosted on a VFP form), and had to go through stylesheet rules - not as they are in the stylesheet, but as live objects. Luckily, in a webpage the font size are floating point numbers and the browser will just render them the best it can.Unfortunately, this won't work for Fox controls - you can multiply .fontsize with 1.1, but a 9px will remain a 9px; if you multiply with 1.2, it becomes a 10, no decimals. It's not even rounding, it's taking int().

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform