forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TEXT_ARRAY sizing questions

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Wed Mar 11, 2015 3:58 pm    Post subject: TEXT_ARRAY sizing questions Reply with quote

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:
Code:

    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
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Mar 11, 2015 4:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Wed Mar 11, 2015 5:07 pm    Post subject: Reply with quote

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

Bill
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Mar 11, 2015 6:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group