I have a bitmap font in which each character is 32px. I create individual characters with this font and assign them to display objects, of which each object is 32px and the objects scale value is 1.0 (full scale)
Now what I am trying to do is make my font creation routine standardised to accept font sizes in it’s function call.
So i can do say :
loadFont( font, size )
So we know 32px is the base font size and that has a scale of 1.0. How would a formula work that can calculate the scale based on the size passed.
For instance, 16px would be 0.5 scale (exactly half the scale of the base font size) that one is easy.
But say I wanted 24px, 18px, 12px and so on?
Thanks in advance
This hardly requires a math guru, it’s just a simple ratio. A 24px font would be 24/32 or 0.75 for example.