Article View: comp.os.os2.programmer
Article #145Re: can't access resource font
From: David E Nichols
Date: Tue, 03 Nov 1992 16:24
Date: Tue, 03 Nov 1992 16:24
42 lines
2264 bytes
2264 bytes
In article <harris.720655949@garfield.catt.ncsu.edu> harris@garfield.catt.ncsu.edu (Michael Harris) writes:
>davidn@cs.tamu.edu (David E Nichols) writes:
>
>>call= GpiLoadFonts(hab, "lcd.fnt")
>
>This is your problem. The documentation says that you cannot specify anything
>but a .fon file for the name. A .fnt file is nothing but a raw font. A .fon
>file is an empty DLL with font resources attached.
>
>If you want to use GpiLoadFonts, you must compile a dummy entrypoint into
>a DLL and then use the resource compiler to attach the font to the DLL.
>
>Your DLL can consist of nothing but:
>
>main()
>{
>}
>
>Compile that into an .obj file and go from there. You could then install
>the font into your system if you like using the font palette.
>
Thank you for the info. Of course you are absolutely correct, the font has
to be in a DLL (I should have guessed). But when I put main() {} in my
.c file, and compile to a dll (.fon), the font won't install, ie GpiLoadFonts
fails and the WPS will crash and restart if I try installing it. If I
leave the .c file blank, it will partially install with the font palette
utility (the WPS does not crash) but the font is inaccessible and I can't
delete the file in the \os2\dll directory, and GpiLoadFonts still fails.
I think it might have something to do with my module def file:
LIBRARY lcd
DESCRIPTION 'lcd - Digital font for Tracker/PM MOD player'
DATA SHARED
That's it! I guess there should be a reference to the actual font resource
(?) or something, but I'm not sure how to do it. Anyway, if you (or any
other kind soul) could show me the light (again) I would really appreciate
it.
Thanks in advance,
David Nichols
davidn@cs.tamu.edu
Technical Details
Message-ID:
<1992Nov3.162412.5966@tamsun.tamu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!zaphod.mps.ohio-state.edu!cs.utexas.edu!tamsun.tamu.edu!davidnReferences:
<1992Oct31.184358.4532@tamsun.tamu.edu> <harris.720655949@garfield.catt.ncsu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!zaphod.mps.ohio-state.edu!cs.utexas.edu!tamsun.tamu.edu!davidn From: davidn@cs.tamu.edu (David E Nichols) Subject: Re: can't access resource font Message-ID: <1992Nov3.162412.5966@tamsun.tamu.edu> Sender: news@tamsun.tamu.edu (Read News) Organization: Computer Science Department, Texas A&M University References: <1992Oct31.184358.4532@tamsun.tamu.edu> <harris.720655949@garfield.catt.ncsu.edu> Date: Tue, 3 Nov 1992 16:24:12 GMT Lines: 42