# NNS_G2dCharCanvasDrawChar

## Syntax

      #include <nnsys/g2d/g2d_CharCanvas.h>

      int NNS_G2dCharCanvasDrawChar(
      	const NNSG2dCharCanvas* pCC,
      	const NNSG2dFont* pFont,
      	int x,
      	int y,
      	int cl,
      	u16 ccode
      );

## Arguments

pCC | [IN] Pointer to CharCanvas
pFont | [IN] Pointer to font
x | [IN] Upper-left X coordinate of text character (in CharCanvas coordinate system)
y | [IN] Upper-left Y coordinate of text character (in CharCanvas coordinate system)
cl | [IN] Standard color No. to use to draw the text character
ccode | [IN] The character code of the text character to draw

## Return Values

The text character width (left space + glyph width) of the drawn text character. The right edge of the drawn text character is = `x + [Returned value]`.

## Description

Draws the text character ccode to the CharCanvas pCC using the font pFont. The text character gets drawn using transparent color and the required number of colors in sequence from cl. For example, if the font is 3bpp (23=8 colors) and 5 is specified for cl, then drawing will be performed with a total of eight colors: the transparent color (color No. 0) and colors No. 5 through 11.

The coordinates are expressed in the CharCanvas coordinate system, where the upper-left corner of CharCanvas is (0,0).
x and y must satisfy these inequalities:

- [text-character glyph width] < x < [CharCanvas region width] - [text-character's left space width]
- [font height] < y < [CharCanvas region height]

The text character is drawn such that the (x, y) coordinates are positioned on the red dot in the figure below.

When a vertically written font is used, the text characters is drawn such that the coordinates given by (x, y) are positioned on the blue dot shown in the figure above.

## See Also

`NNS_G2dCharCanvasDrawGlyph`

## Revision History

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

CONFIDENTIAL