[comp.sys.amiga.tech] width of font characters

pawn@wpi.wpi.edu (Kevin Goroway) (03/29/89)

Is there any way to get the actual width of a single character of a particular
font given that the font is loaded correctly.

I don't need the width in general of the font (The RKM seems to mention that)
I need it for each specific character...

thanks in advance...


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Pawn@wpi.wpi.edu 		Worcester Polytechnic Institute, Mass, U.S.A. |
| Pawn@wpi.Bitnet		main() { printf("Hello World!\n); }           |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

andy@cbmvax.UUCP (Andy Finkel) (03/30/89)

In article <1569@wpi.wpi.edu> pawn@wpi.wpi.edu (Kevin Goroway) writes:
>Is there any way to get the actual width of a single character of a particular
>font given that the font is loaded correctly.

The TextLength() function can be used for this; its a bit easier
than going into the font data itself.

		andy
-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

"Give me a Standard large enough, and a Committee to discuss it,
 and I will prevent the Earth from moving."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

cmcmanis%pepper@Sun.COM (Chuck McManis) (03/30/89)

In article <1569@wpi.wpi.edu> pawn@wpi.wpi.edu (Kevin Goroway) writes:
>Is there any way to get the actual width of a single character of a particular
>font given that the font is loaded correctly.

	wid = TextLength(rp, "<your char>", 1);

TextLength returns the width in pixels of any arbitrary string in the
RastPort's current font. Use a one character string and a length of one.


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"A most excellent barbarian ... Genghis Kahn!"