NNS_G2dTextCanvasGetTextRect

構文


#include <nnsys/g2d/g2d_TextCanvas.h>

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

引数

pTxn [IN] TextCanvas へのポインタ
txt [IN] 文字列へのポインタ

返り値

文字列を描画した場合の幅と高さを返します。

NNSG2dTextRect 型は以下のように定義されています。

typedef struct NNSG2dTextRect
{
	int width;	// 矩形幅
	int height;	// 矩形高さ
}
NNSG2dTextRect;

説明

文字列 txt を描画した場合の幅と高さを計算します。

縦書きフォントでは幅と高さを逆に計算します。

参照

NNS_G2dFontGetTextRect, NNS_G2dTextCanvasGetStringWidth, NNS_G2dTextCanvasGetTextWidth, NNS_G2dTextCanvasGetTextHeight

履歴

2007/03/14 縦書き/縦持ちフォントに対応。
2005/05/25 初版