🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5855

Re: How find width of prop. Font character?

#5855
From: Peter Cherna
Date: Mon, 15 Oct 1990 15:36
24 lines
1301 bytes
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."
Technical Details
Message-ID: <15156@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!sdd.hp.com!wuarchive!julius.cs.uiuc.edu!psuvax1!rutgers!cbmvax!peter
References: <34830@cup.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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