Path: utzoo!utgpu!water!watmath!clyde!burl!codas!ufcsv!gatech!gtss!chas From: chas@gtss.UUCP (Charles Cleveland) Newsgroups: comp.sys.amiga Subject: Re: font structures Message-ID: <197@gtss.UUCP> Date: 21 Jan 88 15:14:32 GMT References: <196@gtss.UUCP> Reply-To: chas@gtss.UUCP (Charles Cleveland) Organization: Georgia Tech School of Physics Lines: 71 Summary:OK, I give up. Re font structures per se, conflicting reports are still coming in. But perhaps one of you can help me with a related problem alluded to in my original posting. Here is a reduced version, OFT.c, of the program in which I have a problem with an OpenFont call. This program was compiled with Lattice 3.03 with no options except that stack checking was disabled so that I could link just to AStartup.obj, although it is likely to compile under anything. It was compiled via lc1 OFT lc2 -v OFT and linked using Blink 6.5 like this: blink lib amiga.lib from Astartup.obj,OFT.o It is imagined that the program will be executed from a system running without the benefit of SetFont or its brethren, that is, one using only one of the ROM topaz fonts, so that OpenFont will suffice and diskfont.library does not need to be opened. However, the program still SHOULD not misbehave even if this condition does not hold. If I compile the program as listed and run it, I just get a window that opens and closes quick as a bunny. If I redefine CRASH to be TRUE and recompile, running the program generates a GURU indicating an illegal instruction trap although I think I should still just get a window that opens and closes quick as a bunny. I do not understand. I hesitate to infer that the WorkBench Screen the system provides by default has not a NULL TextAttr but a garbaged one. Would someone please point out the manifestation of my brain damage in the next 34 lines? #define INTUITION_REV 33 #include #include #include #include #define CRASH FALSE struct TextFont *font; struct TextAttr *TAttr; struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Window *wp; struct NewWindow NewWindow={ 0,0,320,100,3,1,NULL,NULL,NULL,NULL,"OpenFontTest",NULL,NULL,0,0,0,0, WBENCHSCREEN }; main() { IntuitionBase=(struct IntuitionBase *) OpenLibrary("intuition.library",INTUITION_REV); if(IntuitionBase==NULL)Exit(300); if((wp=(struct Window *)OpenWindow(&NewWindow))==NULL)Exit(301); TAttr=wp->WScreen->Font; if(TAttr){ if(CRASH)font=(struct TextFont *)OpenFont(TAttr); } CloseWindow(wp); CloseLibrary(IntuitionBase); } -- -Life would be so much easier if we could just look at the source code.- Charles Cleveland Georgia Tech School of Physics Atlanta, GA 30332 UUCP: ...!gatech!gtss!chas INTERNET: chas@ss.physics.gatech.edu