[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

	TextLength -- Determine raster length of text data.

	length = TextLength(rp, string, count)
	D0                  A1  A0      D0:16

	WORD TextLength(struct RastPort *, STRPTR, WORD);

	This graphics function determines the length that text data
	would occupy if output to the specified RastPort with the
	current attributes.  The length is specified as the number of
	raster dots: to determine what the current position would be
	after a Text() using this string, add the length to cp_x
	(cp_y is unchanged by Text()).  Use the newer TextExtent() to
	get more information.

	rp     - a pointer to the RastPort which describes where the
	         text attributes reside.
	string - the address of string to determine the length of
	count  - the string length.  If zero, there are no characters
	         in the string.

	length - the number of pixels in x this text would occupy, not
	         including any negative kerning that may take place at
	         the beginning of the text string, nor taking into
	         account the effects of any clipping that may take

	Prior to V36, the result length occupied only the low word of
	d0 and was not sign extended into the high word.

	A length that would overflow single word arithmetic is not
	calculated correctly.

	TextExtent()  Text()  TextFit()
	graphics/text.h  graphics/rastport.h

[Back to Amiga Developer Docs]