NNS_G2dFontGetTextWidth

Syntax


#include <nnsys/g2d/g2d_Font.h>

int NNS_G2dFontGetTextWidth(
	const NNSG2dFont* pFont,
	int hSpace,
	const NNSG2dChar* txt
);

Arguments

pFont [IN] Pointer to font
hSpace [IN] Character interval (in pixels)
txt [IN] Pointer to text string

Return Values

Returns the text string width when drawn (in pixels).

Description

Calculates the width of text string txt when drawn. The value is the maximum of all line widths in txt.

For information on the other arguments, see NNS_G2dTextCanvasInit.

Use this function when you want to know the size of the string before creating the TextCanvas. For example, use it when you are dynamically creating the smallest CharCanvas that can display all of txt. When TextCanvas is already created, use NNS_G2dTextCanvasGetTextWidth.

For a vertically written font, this function calculates the string's height.

See Also

Revision History

2007/03/14 Added support for vertically written/vertically held fonts.
2005/05/25 Initial version.


CONFIDENTIAL