View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 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: 457 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: 2402 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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 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: 8211 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 |
|
 |
|