Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > a2116f36018873d572acbcadddb8e994 > files > 940

clanlib0.8-docs-0.8.1-22.mga7.i586.rpm


<!-- clanlib header begin -->
<HTML>
<HEAD>
<TITLE>CL_Font::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_Font::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 inserted. This could be negative if it backtracks.<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> Each glyph inserted into the CL_GlyphBuffer corresponds with exactly one character of the input string, with
  the order in the vector and the order in the string being the same. That is, if you start out with an empty CL_GlyphBuffer,
  run this method on it, and afterwords the CL_GlyphBuffer contains 100 glyphs, then you know the first 100 characters
  of the source string range were processed. This includes whitespace and newline characters.</p>
  <p> If you call this method on a CL_GlyphBuffer with a last line that is center-justified or left-justified, be aware
  that there's no way for this function to differentiate that line from a left-justified line with an indent, and it
  always assumes the latter. </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><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_Font.html">CL_Font</a> | <a href="CL_GlyphBuffer.html">CL_GlyphBuffer</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 -->