# NNS_G2dTextCanvasGetTextWidth

## Syntax

      #include <nnsys/g2d/g2d_TextCanvas.h>

      int NNS_G2dTextCanvasGetTextWidth(
      	const NNSG2dTextCanvas* pTxn,
      	const NNSG2dChar* txt
      );

## Arguments

pTxn | [IN] Pointer to TextCanvas
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 a vertically written font, this function calculates the string's height.

## See Also

`NNS_G2dFontGetTextWidth, NNS_G2dTextCanvasGetStringWidth, NNS_G2dTextCanvasGetTextHeight, NNS_G2dTextCanvasGetTextRect`

## Revision History

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

CONFIDENTIAL