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 

Font and font size

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



Joined: 14 Nov 2007
Posts: 303
Location: Düsseldorf, Germany

PostPosted: Sat Apr 01, 2017 10:48 am    Post subject: Font and font size Reply with quote

Beginning with the main program, I use %fn[MS SANS SERIF]%ts with .96D0 (size, argument for %ts) in any winio@ window, which means dozens of times within one single program. My question is, whether there is a way to define font and font size once at the beginning of the code, for all subsequent windows?

Thanks in advance
Wilfried
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 01, 2017 11:19 am    Post subject: Reply with quote

You can use %gf after the first time, storing the result as a font HANDLE. This will be a 64 bit integer in 64 bit applications.

Then use %fh to set the font using the saved font HANDLE afterwards.

But the font HANDLE will probably be destroyed when the first window closes so this may only work if the handle is created in a main window that remains open.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sat Apr 01, 2017 11:39 am    Post subject: Reply with quote

Paul knows better than me how Clearwin+ works best, but I have a subroutine that sets up all the window attributes, font and font size, background colour etc etc, which I call each time I open a new window. The subroutine contains nothing but the associated winio@ calls, which as you know, can be strung out over several routines.

As the system font is different in various versions of Windows, especially with large font settings, it takes care of all that too.

Eddie
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 303
Location: Düsseldorf, Germany

PostPosted: Sat Apr 01, 2017 11:42 am    Post subject: Reply with quote

Thank you, but that is not really the solution I was looking for:

Instead of each time using %fn[MS SANS SERIF]%ts with an argument for %ts, I then would need each time %fh with an argument, coming from an additional common block or module…

I am looking for a solution similar to set_clearwin_float@("rf_exp_limit",0.001D0) with which I once for all suppress exponential writing of double precision values in %rf. This is one single statement at the beginning of the main program.

Regards - Wilfried
Back to top
View user's profile Send private message Visit poster's website
Wilfried Linder



Joined: 14 Nov 2007
Posts: 303
Location: Düsseldorf, Germany

PostPosted: Sat Apr 01, 2017 11:49 am    Post subject: Reply with quote

Sorry Eddie, my previous post was an answer to Paul's remarks. Your way with a subroutine for all general settings is another interesting alternative.

Wilfried
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 673

PostPosted: Sat Apr 01, 2017 12:38 pm    Post subject: Reply with quote

Wilfried, your post reminded me once more about a shortcoming of the Silverfrost forum setup (phpBB): there is no convenient way of referring to a particular post in a thread. We can reply to what we think of as the "most recent" post, but another reader may post while I am composing, and as a result what I post has to be edited (if I catch the problem).
    I can count from the top and say "#4", but that will give wrong information to another reader who may hav a different setting for the order of presentation, and is too irksome to use in threads with dozens of posts.

    I can quote the time/date of the post, but the times/dates that different readers see are different for any given post. I have now two browser tabs, one of which goes through a VPN filter and the other straight. I see 4:49 AM for your most recent post in one tab, and 11:49 AM for the same post in the other tab.

Paul, please make it possible to add a serial number to each of the posts in a thread.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 01, 2017 12:56 pm    Post subject: Reply with quote

Wilfried

I can't find anything better than Eddie's suggestion but it would be a fairly simple matter to add something to ClearWin+ so that you could set a default font for all subsequent Windows created via winio@.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sat Apr 01, 2017 1:27 pm    Post subject: Reply with quote

I just had a look, and I see that for XP and earlier, I have used MS Sans Serif, with scaling factors 0.8 for y pixels less than 1000, 0.9 for bigger vertical pixel counts, but for Vista and later, the scaling factors are 0.9 and 1.0. I'm using CALL GET_OS_VER@(ID_Platform, MAJOR, MINOR) to decide which version of Windows it runs on.

Interestingly, I only use scaling factors 0.8 (XP & earlier) and 0.9 (Vista and later) with the relevant fonts for dialog boxes that just pop up with warnings.

Using Segoe UI means installing it on a Vista machine.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 01, 2017 2:05 pm    Post subject: Reply with quote

I have added a new routine CLEARWIN_DEFAULT_FONT@(hfont) and will aim to upload a new set of DLLs early next week.

If it works then you will be able to call this routine after (say) using %gf in the first Window to be opened at run time.
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 303
Location: Düsseldorf, Germany

PostPosted: Sat Apr 01, 2017 5:53 pm    Post subject: Reply with quote

Thanks again, Paul and Eddie!

I modified one of my programs according to Eddie's suggestion, with good results. Next time I will try Paul's new routine.

Have a nice weekend!
Wilfried
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sun Apr 02, 2017 8:08 am    Post subject: Reply with quote

On reflection, I might be able to provide something more useful instead.

I am thinking of a function winstyle@ that would work like winio@ but only for certain format codes such as %fn, %ts, %bf, %tc and %bg. This would create a predefined window style for all subsequent calls to winio@. Basically it would automatically store an accumulated format string that would be applied on the first call to winio@ for any subsequent window.

I am assuming that this format string would be internal to ClearWin+ but I suppose that it might even be in a user buffer that the user could then store and change but maybe that would be a bridge too far.

If we take this approach then it will take a little longer to implement.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Apr 02, 2017 11:26 am    Post subject: Reply with quote

Paul,

It's a generous offer, but at the risk of sounding ungrateful, isn't this something that can be supplied by a user using standard existing Clearwin+ and Fortran?

When launching any user interaction window, raw execution speed ceases to be a problem as most computers (including my Windows tablet) are effectively instantaneous. It therefore isn't a problem to nest a few extra subroutine calls - and they shouldn't affect the stack much because they involve few parameters.

Hence, surely the best short term solution is to provide some way of illustrating what can be done by way of a sample subroutine or two?

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1484
Location: South Pole, Antarctica

PostPosted: Sun Apr 02, 2017 9:37 pm    Post subject: Reply with quote

Windows style, Linux rubber Windows style, tablet style, Apple or Android phone style, night style, etc would be ultimately great final touch of Clearwin. We all see how many great looking styles of sliders, buttons and radio buttons, backgrounds exist...Would be great to refresh our programs with new nice looks... Beauty and ugly difference is the matter of few microns color layer and its shape.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Apr 03, 2017 8:08 am    Post subject: Reply with quote

Eddie

Thanks for your concern. I think that your approach is simple and very effective. What I am planning is just a nice little diverting exercise for me that I will offer free of charge.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 503

PostPosted: Wed Apr 05, 2017 6:10 am    Post subject: Reply with quote

Dan ... maybe we should adopt this as the Silverfrost theme-tune ? Wink
... with Paul on banjo pulling all the strings of course Smile?

https://www.youtube.com/watch?v=TW9KUeMaJRQ
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