CL_TextStyler::get_height - ClanLib Game SDK

Home | All Classes | Grouped Classes | Index | Search

# CL_TextStyler::get_height

Returns the drawn height of some source text, or of the default font if no arguments passed.

    	int get_height();

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

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

Parameters:

str
  The source string to parse and render.
start
  A starting iterator, inclusive.
end
  An ending iterator, exclusive.
max_size
  Acts like the size of a dest rectangle passed to draw(), for height truncating and word wrapping.

Return value:

The height in pixels.

Detailed description:

Generally, get_height(" ") will return zero, since usually the space glyph isn't given in the font, and so it has a height and width of zero. Calling get_height() on a CL_TextStyler without arguments is the same as calling get_height() without arguments on that CL_TextStyler's default font.

See also:

CL_Size | CL_TextStyler

Questions or comments, write to the ClanLib mailing list.