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 

Resauces 2

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sun Mar 29, 2020 10:03 pm    Post subject: Resauces 2 Reply with quote

Can a specific font (non-Windows supplied) be made available to (incorporated within ) a program via a RESOURCE file ?

Is there an example somewhere demonstrating how to do it hidden within the catacombs of the documentation ?

Ta.

(and keep safe y'all out there wherever you are)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 30, 2020 9:49 am    Post subject: Reply with quote

Microsoft does not include fonts in its list of standard resources.

https://en.wikipedia.org/wiki/Resource_(Windows)

In theory you can use arbitrary binary data (which could be font data) as a resource but, off hand, I don't know how you could use this in a ClearWin+ program.

There are standard ways to import fonts to a user's font library. It would then be possible to access them via ClearWin+ routines such as get_font_name@.

There may be ClearWin+ users who could provide more insight.
Back to top
View user's profile Send private message AIM Address
Robert



Joined: 29 Nov 2006
Posts: 445
Location: Manchester

PostPosted: Mon Mar 30, 2020 11:07 am    Post subject: Reply with quote

I don't think you can use a font unless it is explicitly installed into Windows.
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: Mon Mar 30, 2020 11:09 pm    Post subject: Reply with quote

What you can do is put the font in the installer program. I use Inno Setup from Jordan Russell software, which is freeware. Basically, you can specify your EXE, DLLs (including salflibc.dll) and fonts to be installed, and Inno Setup puts everything in a single executable for you. At install time everything is unpacked and put where you want it.

Eddie
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Apr 01, 2020 9:46 pm    Post subject: Reply with quote

Paul, Robert and Eddie, thnks for the replies

Paul ... au contraire, Font is listed here (your link corrected) as a standard resource :
https://en.wikipedia.org/wiki/Resource_(Windows)
and more precisely here
https://docs.microsoft.com/en-us/windows/win32/menurc/resource-definition-statements
and here:
https://docs.microsoft.com/en-us/windows/win32/menurc/font-resource

Your idea is a good back-up option Eddie.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Apr 01, 2020 9:49 pm    Post subject: Reply with quote

all this business with Resources and what can be done really does need up-scaling in the ftn95 documentation imo

Even if it' just quoting a foray of good links to good explanations ont' web.

It' all a bit of a 'black art' for a lot of us I'd wager.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 02, 2020 8:17 am    Post subject: Reply with quote

John

Thank you for the correction. I will look a little further. I was confused by the fact that Microsoft do not support FONT resources in my versions of the Visual Studio resource editor.

The resource compiler SRC will accept a line in a script of the form...

myfont FONT "cmroman.fnt"

but at the moment I don't know how that might be used.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 04, 2020 12:14 pm    Post subject: Reply with quote

Just to let you know that I have spent some time on this without a great deal of success. There is demo C++ code available on the "CodeProject" website for a font called "SkiCargo" and I can import this code into ClearWin+ in a way that works for 32 bits but when I try other fonts or move to 64 bits, I can't get it to work.

If anyone has the skill to get the "CodeProject" code to work satisfactorily then I am willing to include this in ClearWin+.

Importing a font from a file appears to be more straight forward but not from a resource. Basically, Microsoft provides very little support for this and expect you to use the system font library. They have functions for LoadBitmap, LoadIcon, LoadCursor, etc. but not one to load a private font in an equivalent manner.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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