Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bu.edu!rpi!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: default font heigth under 2.0 Message-ID: <14693@cbmvax.commodore.com> Date: 27 Sep 90 19:17:05 GMT References: <90270.154651GDAL3AI@cc1.kuleuven.ac.be> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 40 In article <90270.154651GDAL3AI@cc1.kuleuven.ac.be> GDAL3AI@cc1.kuleuven.ac.be writes: >I'm looking for a way to find the heigth of the default system font >under 2.0 . The problem I have is the following: I want to print a >text in a window via PrintIText. I want to determine the window >heigth before opening it so I get a nice window that fits around >the text. What is the right way to do this ??? (under 2.0) >BTW. I find the Width by using IntuiTextLength (or something like that, >can't remember... is that right too ???) >If you can help me with this, please respond as fast as possible, 'cos >I'll leave soon.. Under 2.0, your window titlebar will contain the screen's font. To determine the height your window top border will be, perform the following calculation: topborder = screen->WBorTop + (screen->Font->ta_YSize + 1); To be safe, you should use the 2.0 Intuition function LockPubScreen(NULL) to get the screen pointer of the default public screen (usually Workbench), then open your window using win = OpenWindowTags(&newwin, WA_PubScreen, screen, TAG_DONE); then call UnlockPubScreen(NULL, screen). The default font for rendering IN the window is GfxBase->DefaultFont. IntuiTextLength() (or graphics/TextLength()) tells you how wide your text will be. The new graphics.library call TextExtent() gives you information about both width and height. > I. Aerts Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.cbm.commodore.com My opinions do not necessarily represent the opinions of my employer. "Very strange... the window is broken on both sides."