Hello,
First you have to decide what the ideal display is for your fonts. Maybe you think 1024X768 is ideal (realizing that the screen display may differ). For your ideal display size with your ideal font size, find the ratio of the width and height of the text against the screen size.
It won't be exact put a pretty good width to use is a capital Q
idealfontwidth=TEXT WIDTH("Q")
A decent measure for font height are the letters "gM"
idealfontheight=TEXT HEIGHT("gM")
Now find the relationship between the screen width and height and the font sizes:
widthratio#=idealfontwidth/idealscreenwidth
heightratio#=idealfontheight/idealscreenheight
Maybe save these values in a setup file or something to be used for whatever display is required. You are only creating and saving these once ahead of time outside of the program that you intend to have varying display sizes. These values ARE NOT created within the program you want to resize the font in.
In the program that the display may vary from computer to computer or for wahtever reason, load in the values from a file or hard code them into the source.
The new font size is always based on the font height (at least that's how it used to be) so use the font height ratio to set the new font size:
fontsize=screen height() * heightratio#
SET FONT SIZE fontsize
You can use the width ratio to help you tweak
Enjoy your day.