# NNS_G2dTextCanvasGetTextRect

## Syntax

      #include <nnsys/g2d/g2d_TextCanvas.h>

      NNSG2dTextRect NNS_G2dTextCanvasGetTextRect(
      	const NNSG2dTextCanvas* pTxn,
      	const NNSG2dChar* txt
      );

## Arguments

pTxn | [IN] Pointer to TextCanvas
txt | [IN] Pointer to text string

## Return Values

Returns the width and the height of a drawn text string.

The `NNSG2dTextRect` struct definition follows:

    typedef struct NNSG2dTextRect
    {
    	int width;	// Rectangle width
    	int height;	// Rectangle height
    }
    NNSG2dTextRect;

## Description

Calculates the height and width that string txt has when drawn.

For the vertically written fonts, width and height are swapped when calculated.

## See Also

`NNS_G2dFontGetTextRect, NNS_G2dTextCanvasGetStringWidth, NNS_G2dTextCanvasGetTextWidth, NNS_G2dTextCanvasGetTextHeight`

## Revision History

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

CONFIDENTIAL