Home | All Classes | Grouped Classes | Index | Search

CL_Font::get_size

Returns the drawn size of a string.

	CL_Size get_size(
		unsigned char letter);

	CL_Size get_size(
		const std::string& str, const CL_Size& max_size = CL_Size(0, 0), const std::string& delim = std::string(" "));

	CL_Size get_size(
		const std::string::const_iterator& start, const std::string::const_iterator& end, const CL_Size& max_size = CL_Size(0, 0), const std::string& delim = std::string(" "));

Parameters:

letter
Character to get the size of. If unrecognized, returns space width.
str
String to get the size of.
start
A starting iterator, inclusive.
end
An ending iterator, exclusive.
max_size
Same effect as the size of the dest rectangle passed to draw(), for word wrapping and height truncating
delim
When word-wrapping, specifies characters (other than newlines) that act as word seperators.

Return value:

The size in pixels.

Detailed description:

If all you want is the size, then its more efficient to call this function than to use test_draw.

See also:

CL_Font



Questions or comments, write to the ClanLib mailing list.