Path: utzoo!attcan!uunet!know!sdd.hp.com!wuarchive!julius.cs.uiuc.edu!psuvax1!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: How find width of prop. Font character? Message-ID: <15156@cbmvax.commodore.com> Date: 15 Oct 90 15:36:54 GMT References: <34830@cup.portal.com> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 24 In article <34830@cup.portal.com> Lee_Robert_Willis@cup.portal.com writes: > > >Does anyone know how to find the width of a single character within >a proportional font, without using 'TextLength()'? (The font/character >pair may not be the current font of the RastPort.) Easy. Create a spare RastPort, and establish its font to the one you want to measure. Something like: struct RastPort tempRP; InitRastPort( &tempRP ); SetFont( &tempRP, myfont ); len = TextLength( &tempRP, text, len ); > (Lee_Robert_Willis@cup.portal.com) 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. "Television is a medium because it is neither rare nor well-done."