Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!amiga!andy From: andy@amiga.UUCP (Andy Finkel) Newsgroups: net.micro.amiga Subject: Re: OpenFont() and OpenDiskFont() in 1.2 Gamma (possible bug?) Message-ID: <1594@amiga.amiga.UUCP> Date: Sat, 1-Nov-86 14:59:27 EST Article-I.D.: amiga.1594 Posted: Sat Nov 1 14:59:27 1986 Date-Received: Mon, 3-Nov-86 23:56:55 EST References: <8610311855.AA29341@cory.Berkeley.EDU> Reply-To: andy@skipper.UUCP (andy finkel) Organization: Commodore Business Machines, 1200 Wilson Drive, West Chester, PA 19380 Lines: 52 In article <8610311855.AA29341@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes: > > So, I set up the Text Attribute with the font name and font Ysize, >set everything else to 0, and call OpenFont(). If it fails I set the >flags field to FPF_DISKFONT, open the DISKFONT library, and call >OpenDiskFont(). > > >-I open ruby.font w/Ysize = 8, no problem, it works fine. The program fails >on OpenFont() and works with OpenDiskFont(). > >-I open ruby.font w/Ysize = 12. OpenFont() does NOT fail.. it gives me the >ruby.font/8 that I openned earlier. > > Is this a bug with OpenFont() or am I supposed to double check >fonts returned to me? > > -Matt This is actually a feature. OpenFont (and OpenDiskFont) attempt to give you the font that is closest to what you asked for. The first time you asked for ruby 8, OpenFont checked the system font list. Finding no ruby fonts of any kind, it immediately fails. The second time you call it, OpenFont, on checking the system font list, finds a ruby font. It then tries to give you the closest size match (it starts on the size you asked for, then steps down by 2 sizes for every one it steps up; it other words, if you ask for size 12, sizes 11 and 10 are more acceptable than size 13. This is why it returns with ruby 8. (OpenDiskFont uses the same algorithm, by the way) You need to check what font you got on return, because there may be a more acceptable font on disk. Keep the order you've got, though (OpenFont, then OpenDiskFont)...it cuts down on disk accesses. andy finkel -- andy finkel Commodore(Amiga) {ihnp4|seismo|allegra}!cbmvax!andy or pyramid!amiga!andy Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors. "Remember, no matter where you grow, there you are." - Buckaroo Bonsai.