Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!oliveb!amiga!jimm From: jimm@amiga.UUCP (Jim Mackraz) Newsgroups: comp.sys.amiga.tech Subject: Re: What font does Intuition use? Keywords: Intuition, IntuiText, TextAttr Message-ID: <3235@amiga.UUCP> Date: 6 Jan 89 20:50:08 GMT References: <10236@well.UUCP> Reply-To: jimm@cloyd.UUCP (Jim Mackraz) Organization: Commodore-Amiga Inc, Los Gatos CA Lines: 60 In article <10236@well.UUCP> shf@well.UUCP (Stuart H. Ferguson) writes: ) )When I create an IntuiText structure, I give it a pointer to a TextAttr )structure to use for rendering the text. I assume that the specified font )needs to be in memory for Intuition to find it, and that if it doesn't, )it will just pick a font. Any way to find out what font it really is using? It uses the current rastport font, if there is a rastport involved (e.g., PrintIText( rp, itest, l, t )). If not, the situation is somewhat ill-defined. The only example I know which has IText not associated with a rastport is IntuiTextLength( itext ). In this case, we use a fresh rastport initialized by InitRastPort(), which sets up the graphics default font. Intuition tries to keep graphics idea of default font in sync with preferences and its own idea of default font. )Baring that, is there an equivalent to the IntuiTextLength() call for )finding the font height? When I use the ta_YSize field of my TextAttr )structure, but Intuition has picked another, more convient font, all my )attempts at being clever in laying out text are for naught since the )font is not the size I think it is. Needless to say, the results look )terrible. Why not do what Intuition does? Take the rastport (or a copy of it, or a new rastport with InitRastPort() ), try an OpenFont(), if succeeds, use the height of the font returned, else, use the font set in the rastport. )Thanx in advance. ) )As an aside: Why doesn't Intuition look on disk for the font if it can't )find it in memory? It has to do with general principles and specific problems. The general principle is something like "Intuition shouldn't call the DOS." The specific problems are handling disk requesters gotten by OpenDiskFont(), stack blowout in calling the dos, and probably some others that I haven't suffered since$ haven't tried it. We're looking hard at using disk fonts (gotten from disk) at least for the default Intuition font, so maybe we'll be able to change this someday. In the meantime, you have to pull them in off of disk yourself. Here's an example of the type of problem: suppose you have menu verify set, and say PrintIText() or RefreshGList(), or anything that does text. Intuition tries to open the font and pulls a requester. Then the user hits the menu button. Party is over (I waits for you, and you wait for a gadget click). Worse yet, what if Intuition pulls a requester when it is running as the input device (refreshing your gadgets after window depth arrangement)? )(Or am I just off the wall on this one?) Not off the wall, you just don't appreciate how fun this job can get ... ;^) ) Stuart Ferguson (shf@well.UUCP) ) Action by HAVOC jimm -- Jim Mackraz, I and I Computing "Like you said when we crawled down {cbmvax,well,oliveb}!amiga!jimm from the trees: We're in transition." - Gang of Four Opinions are my own. Comments are not to be taken as Commodore official policy.