Path: utzoo!attcan!uunet!ns-mx!iowasp.physics.uiowa.edu!maverick.ksu.ksu.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!murdu!ucsvc.ucs.unimelb.edu.au!wehi!baxter_a From: BAXTER_A@wehi.dn.mu.oz Newsgroups: comp.sys.amiga.tech Subject: Re: Trouble with ADOS 1.3 and Fonts Message-ID: <13693@wehi.dn.mu.oz> Date: 2 Oct 90 14:14:59 GMT References: <13387@wehi.dn.mu.oz> <17f70f12.ARN01888@swinjm.UUCP> Followup-To: comp.sys.amiga.tech Organization: Walter & Eliza Hall Institute Lines: 50 In article <17f70f12.ARN01888@swinjm.UUCP>, forgeas@swinjm.UUCP (Jean-Michel Forgeas) writes: > In article <13387@wehi.dn.mu.oz>, BAXTER_A@wehi.dn.mu.oz writes: > >> While I'm at it, this one has had me worried for _AGES_. >> >> In my program, I open a font. I close it and quit. Memory counter drops >> a bit. No deal. Flush fonts. No memory loss. Fair enough. After I run >> the program, the font sits in memory, and takes up space. >> [...] >> SO: each time I run the program, I get a _new_ copy of the font in memory. > > Are you opening the font with OpenDiskFont() ? This function does not > look for previously loaded fonts in memory, but reload them from disk > every time it is called. Yes. That's not what my autodocs say. > >> This copy doesn't come from disk (no access), it is copied from one >> part of memory to another. > > Perhaps you do not see any disk access because you are using AddBuffers, > FaccII, DiskSpeed, or a like ? > Perhaps >> QUESTIONS: Is this a bug? Is there a special way of asking for fonts that >> actually lets you use the one already there? Is there any salvation in >> 2.0? > > I had a problem like that and found the solution into a C= documentation > (don't remember which one, perhaps AmigaMail), here it is: > > - Do an OpenFont() to get the previously loaded font in memory > - If successfull, compare the Y size obtained with the one you really > want, because if you ask Times15 and there is Times24 in memory, > OpenFont will succes with Times24. > - So if you did not get what you want do an OpenDiskFont() > > With this method, the opened font stays in memory, but every time you > run your program it will find it so will not reload it. That's more or less what I ended up with. My main problem was the use of a font for menus/screen default. That did not work at all well unless I did as you suggest first, then open the screen, not use the font, but let the system find it in memory when it does screen bars/menus, close the screen when finished, and then close the font. Regards Alan