Home | All Classes | Grouped Classes | Index | Search

# CL_Font::get_size

Returns the drawn size of a string.

    	CL_Size get_size(
    		unsigned int letter);

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

    	CL_Size get_size(
    		std::string::const_iterator start, std::string::const_iterator end, CL_Size max_size = CL_Size(0, 0));

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.

Return value:

The size in pixels.

See also:

CL_Size | CL_Font

Questions or comments, write to the ClanLib mailing list.