View previous topic :: View next topic |
Author |
Message |
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sun Mar 29, 2020 10:03 pm Post subject: Resauces 2 |
|
|
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 ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Mar 30, 2020 9:49 am Post subject: |
|
|
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 |
|
|
Robert
Joined: 29 Nov 2006 Posts: 445 Location: Manchester
|
Posted: Mon Mar 30, 2020 11:07 am Post subject: |
|
|
I don't think you can use a font unless it is explicitly installed into Windows. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Mar 30, 2020 11:09 pm Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Apr 01, 2020 9:49 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu Apr 02, 2020 8:17 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Sat Apr 04, 2020 12:14 pm Post subject: |
|
|
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 |
|
|
|