Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!cbmehq!cbmfra!swinjm!forgeas From: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Newsgroups: comp.sys.amiga.tech Subject: Re: Opening a diskfont?? Message-ID: <187c1496.ARN0b44@swinjm.UUCP> Date: 7 Jan 91 10:55:18 GMT References: Reply-To: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Followup-To: comp.sys.amiga.tech Organization: The Software Winery Lines: 38 Expires: Keywords: Distribution: In article , Bob Fahey writes: > I am programming a utility in C (lattice), and need to open a specific font off of a disk. (the font > is already stored in the fonts: dir of my boot disk). > > How do you go about opening that disk-based font? I have tried and tried, but seem to only be able > to open the rombased fonts.... Here is the routine I'm using. It looks in ram before the disk. It is necessary to verify tf_YSize because if a font is found in ram with a different size, OpenFont() will success. Before using this you have to fill the TextAttr structure. struct TextFont *LoadThisFont( struct TextAttr *TextAttr ) { struct TextFont *font; if ((font = (struct TextFont *) OpenFont( TextAttr )) && Font->tf_YSize != TextAttr->ta_YSize) { CloseFont( font ); font = 0; } if (! font) { TextAttr->ta_Flags = FPF_DISKFONT; font = (struct TextFont *) OpenDiskFont( TextAttr ); } return( font ); } Hope this help. -- \___/ Jean-Michel Forgeas \-/ cbmvax!cbmehq!cbmfra!swinjm!forgeas | The Software Winery -^- And, where is the universe ?