flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to make a font resource using fasmw macros? |
Author |
|
madmatt 15 Feb 2006, 20:00
How would you define a font resource using fasmw's resource macros?
|
|||
15 Feb 2006, 20:00 |
|
dr_dred 16 Feb 2006, 13:08
;in make.bat:
... rc.exe rsrc.rc ... ;in .asm file: ... section '.rsrc' resource from 'rsrc.res' data readable |
|||
16 Feb 2006, 13:08 |
|
UCM 17 Feb 2006, 18:01
try this:
Code: directory [....] \ RT_FONT,font [...] resource font,[whatever],LANG_NEUTRAL,fontd [...] resdata fontd file [..whatever file] endres please tell me if it works, and tell me if it doesn't. |
|||
17 Feb 2006, 18:01 |
|
Reverend 18 Feb 2006, 11:59
I didn't try it, but I don't think it would work. There are two types of font resources RT_FONTDIR and RT_FONT. AFAIK, they both need to be somehow assembled into executable. The question is how to achieve this?
|
|||
18 Feb 2006, 11:59 |
|
madmatt 19 Feb 2006, 08:42
UCM, I've tried that and doesn't work so far, I'm trying to load a font for use that is not in the windows font folder, but with no luck so far. There is no easy way to do it, this is stupid! It would have been nice for Microsoft to include a simple "LoadExternalFont" function.
|
|||
19 Feb 2006, 08:42 |
|
UCM 19 Feb 2006, 18:31
try the AddFontResource function.
does that work for you? (p.s. then you would load the font with CreateFont) Win32 API reference wrote: int AddFontResource( _________________ This calls for... Ultra CRUNCHY Man! Ta da!! *crunch* |
|||
19 Feb 2006, 18:31 |
|
madmatt 19 Feb 2006, 19:34
Hello Everyone,
First of all, thaks to everyone for there help. I think I've found a way to do it, and without bloating your executable with font files! Download the code below and see if this works on you system (see WM_CREATE where all the setting up is done, and WM_PAINT for the text printing and WM_DESTROY for closing the font and removing the resouce) :
|
|||||||||||
19 Feb 2006, 19:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.