Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!cbmvax!cbmehq!cbmfra!swinjm!forgeas From: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Newsgroups: comp.sys.amiga.tech Subject: Re: Trouble with ADOS 1.3 and Fonts Message-ID: <17f70f12.ARN01888@swinjm.UUCP> Date: 28 Sep 90 13:20:18 GMT References: <13387@wehi.dn.mu.oz> Reply-To: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Followup-To: comp.sys.amiga.tech Organization: The Software Winery Lines: 45 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. > 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 ? > 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. > Regards Alan -- \___/ Jean-Michel Forgeas \-/ cbmvax!cbmehq!cbmfra!swinjm!forgeas | The Software Winery -^- And, where is the universe ?