Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!umd5!uflorida!gatech!ncsuvx!ece-csc!rss From: rss@ece-csc.UUCP (ML) Newsgroups: comp.sys.amiga.tech Subject: Re: Font help needed Message-ID: <3651@ece-csc.UUCP> Date: 9 Jun 88 17:33:25 GMT References: <62300001@hobbiton> <62300003@hobbiton> Reply-To: rss@ece-csc.UUCP (ML) Organization: the loony bin Lines: 41 In a previous article tran@hobbiton.prime.com wrote: >BEGIN > Gfx := OpenLibrary(ADR("graphics.library"),0); (* Just in case *) > Intu := OpenLibrary(ADR("intuition.library"),0); (* Just in case *) > Dfon := OpenLibrary(ADR("diskfont.library"),0); ... > ft := OpenDiskFont(ta); > SetFont(win^.RPort^,ft^); > >Now, the code drops dead at the OpenDiskFont call. What am I doing wrong? >As far as I can see, it should work. I have added all your responses so far >(diamond.font in lowercase, adding the diskfont.library, etc) but still this >turkey refuses to fly. I may be off base here, since I program in C and not Pascal, but ... As I understand it, routines like OpenDiskFont et al are actually stubs which use the library base pointers and apply offsets to these pointers to get a jump vector to the real routine. The library base pointer used in these routines therefore must be a global variable which also must be named correctly: GfxBase IntuitionBase DiskfontBase or whatever, rather than Gfx, Intu, and Dfon. If you OpenLibary(x) and assign it to Dfon; then call OpenDiskFont; it does something like "Jump to Subroutine @ address (DiskfontBase - 30)" -- but you haven't set DiskfontBase, just your own variable "Dfon" & so you usually get a visit from the Guru. I found (at least with Lattice C) that something somewhere apparently declares these global variables, if not actually setting them, so that the linker was NOT kind enough to tell me that "DiskfontBase" or whatever was undefined. Remember -- take this "explanation" with a grain of salt. I'm guessing, and playing footloose and fancy-free with my explanation to boot. Hope it helps... Mark Lanzo ...!mcnc!ece-csc!rss