Silverfrost Forums

Welcome to our forums

TEXT_ARRAY sizing questions

11 Mar 2015 2:58 #15874

I am using a text array, and apply a scaling factor. The question I have regards use of the scaling factor that one can apply. The results are not 'linear', meaning 50% is not 1/2 the size in both height and width.

The basic code segment used for the code is:

 	k = winio@('%fn[Courier New]%ts%bf&',SCREEN_SCALING)
	k = winio@('%^33.80tx&',SCREEN_DATA,SCREEN_ATTR,80L,33L,KEYSTROKE)
....

%fn to set the font, %ts to set the scaling, %bf to make it all bold.

As the double SCREEN_SCALING is changed, the change in the size of the displayed window and the displayed font is not linear. Specifically, when I scaled between 0.8 and 0.9, the height changed, but not the width.

Any thoughts, and, if there is a better fixed size font solution, what should I change to make the scaling change more linear?

Other than this minor question, I really like the capabilities and flexibility text array has given my program.

Bill

11 Mar 2015 3:58 #15877

If you look in Plato and open the Options dialog box on the Tools menu then the list of fonts contains only fixed size fonts. But if you want to distribute your application then you will need to use a font that is widely available.

11 Mar 2015 4:07 #15878

Thanks, Paul. I saw that but didn't catch the nuance.

Bill

11 Mar 2015 5:39 #15879

Font sizing is an art.

Different versions of Windows use different default system fonts, so a good bet would be to either get your windows version and work from that as a starting point, or wrap your application up in an installer (i.e. something that makes a SETUP.EXE) and install a font like Segoe UI (Win 7's default)

Clearwin+ works in units of the average character size, and this is then rounded in some way to produce an integer number of pixels high and wide. If you want to put a grid of this on your window temporarily there is a format code to do it. As the character cell may be an odd number of pixels high or wide, halving it won't be exact., and indeed some scale factors won't seem to give you a change, e.g. 0.9 of 6 pixels is still 6 pixels.

Fixed size fonts are a bit of a hangover from Windows 1 and they are even less scalable (if at all) ....

Eddie

Please login to reply.