<!-- clanlib header begin --> <HTML> <HEAD> <TITLE>CL_TextStyler::draw_to_gb - ClanLib Game SDK</TITLE> <STYLE TYPE="text/css"><!-- HTML BODY { font-family: verdana, helvetica, sans-serif; font-size: 12px; } H1 { font-size: 22px; } H2 { font-size: 18px; } H3 { font-size: 16px; } H4 { font-size: 14px; } P { font-size: 12px; } LI { font-size: 12px; } --></STYLE> </HEAD> <body bgcolor=white text=black link=blue vlink=#800080> <center> <img src="http://clanlib.org/gfx/clanlib.png"> </center> <!-- clanlib header end --> <center> <p> <a href="http://clanlib.org/docs.html">Home</a> | <a href="classes.html">All Classes</a> | <a href="modules.html">Grouped Classes</a> | <a href="index.html">Index</a> | <a href="search.html">Search</a> </p> </center> <h1>CL_TextStyler::draw_to_gb</h1> <p> Inserts data into a CL_GlyphBuffer, treating the glyphs already there as part of a previous draw_to_gb().</p> <pre> 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)); </pre> <p><b>Parameters:</b></p> <dl> <dt><i>str</i></dt><dd>The input string to draw.</dd> <dt><i>start</i></dt><dd>String position to begin drawing at, inclusive.</dd> <dt><i>end</i></dt><dd>String position to end drawing at, exclusive.</dd> <dt><i>max_size</i></dt><dd>Sets size for word wrapping and height truncating. Either can be zero to disable that feature.</dd> <dt><i>gb</i></dt><dd>The glyph buffer to mess with.</dd> </dl> <p><b>Return value:</b></p> <p>The number of glyphs that were drawn.<br></p> <p><b>Detailed description:</b></p> <p> 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.</p> <p> 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. </p> <p> 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.</p> <p> Scale tags create new font markers in the GB, they don't use the GB scale effects map. </p> <p><b>See also:</b></p> <p><a href="CL_Size.html">CL_Size</a> | <a href="CL_TextStyler.html">CL_TextStyler</a> | <a href="CL_GlyphBuffer.html">CL_GlyphBuffer</a> | <a href="CL_Font.html">CL_Font</a></p> <!-- clanlib footer begin --> <center><br><br><font color="#a0a0a0"> Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>. </font></center> </body> </html> <!-- clanlib footer end -->