Home | All Classes | Grouped Classes | Index | Search

CL_Font::draw_to_gb

Insert glyphs and the font into a CL_GlyphBuffer.

	CL_Font::PrintInfo draw_to_gb(
		int x, int y, const std::string& str, CL_GlyphBuffer& gb);

	CL_Font::PrintInfo draw_to_gb(
		const CL_Rect& dest, const std::string& str, CL_GlyphBuffer& gb, const std::string& delim = std::string(" "));

	CL_Font::PrintInfo draw_to_gb(
		int x, int y, const std::string::const_iterator& start, const std::string::const_iterator& end, CL_GlyphBuffer& gb);

	CL_Font::PrintInfo draw_to_gb(
		const CL_Rect& dest, const std::string::const_iterator& start, const std::string::const_iterator& end, CL_GlyphBuffer& gb, const std::string& delim = std::string(" "));

Parameters:

str
The input string to draw.
start
String position to begin drawing at, inclusive.
end
String position to end drawing at, exclusive.
x, y
Anchor position to draw at. Actual drawing position depends on the alignment mode.
gb
Glyph buffer to insert glyphs/font into.
dest
Rectangle to draw text in. The text will be word-wrapped against delimiters to fit inside the rectangle.
delim
When word-wrapping, specifies characters (other than newlines) that act as word seperators.

Return value:

A CL_Font::PrintInfo, containing stats about the text that was inserted.

Detailed description:

You can specify a dest rectangle with a width or height of zero or less to disable word wrapping or height truncating, respectively.

See also:

CL_Font



Questions or comments, write to the ClanLib mailing list.