Home | All Classes | Grouped Classes | Index | Search
Inserts data into a CL_GlyphBuffer, treating the glyphs already there as part of a previous draw_to_gb().
int draw_to_gb( const std::string& str, CL_GlyphBuffer& gb, CL_Size max_size = CL_Size(0, 0)); int draw_to_gb( std::string::const_iterator start, std::string::const_iterator end, CL_GlyphBuffer& gb, CL_Size max_size = CL_Size(0, 0));
Parameters:
Return value:
The number of glyphs that were drawn.
Detailed description:
The CL_GlyphBuffer's contents (the glyphs vector, the font markers map, and the effects maps), if any, must not have been created/altered by anything but CL_Font::draw_to_gb() and/or CL_TextStyler::draw_to_gb() for this method to work.
If you are doing draw_to_gb several sequential times to the same CL_GlyphBuffer, then you must pass the same maximum width to each call of draw_to_gb.
You can tell when you've filled the buffer up to the height in max_size when a call to this method returns anything less than the size of the string. There's also the chance that it will backtrack and return a negative value if it runs out of vertical space in the process of wrapping a just-completed word; this is still a sign that you've ran out of vertical space.
Scale tags create new font markers in the GB, they don't use the GB scale effects map.
See also:
CL_Font | CL_GlyphBuffer | CL_Size | CL_TextStyler