Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > 98920281af4e2e96d5ea984cee4f9e2f > files > 1714

clanlib0.8-docs-0.8.1-5mdv2010.1.i586.rpm


<!-- clanlib header begin -->
<HTML>
<HEAD>
<TITLE>CL_GlyphBuffer - 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>Class CL_GlyphBuffer</h1>
<p>  Stores and draws glyphs in one or more fonts. <a href="#description">More...</a></p>
<p>Derived from:
<i>none</i>
<br>
Derived by:
<i>none</i>
<br>Group: Display (Fonts)</p>
<p>
#include &lt;ClanLib/display.h&gt;
<p>
<table border=0 width=100%>
</table>
<p><b>Construction:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__CL_GlyphBuffer.html">CL_GlyphBuffer</a></p></td><td valign=top><p>  Constructs a glyph buffer.</p></td></tr></table>
<p><b>Subclasses:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__Glyph.html">Glyph</a></p></td><td valign=top><p>  A character and position describing a glyph in the buffer, stored in the glyphs vector.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__Range.html">Range</a></p></td><td valign=top><p>  Represents a subsection of the buffer</p></td></tr></table>
<p><b>Attributes:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_glyphs.html">get_glyphs</a></p></td><td valign=top><p>  Returns a reference to the glyphs in the buffer and their drawing positions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_font_markers.html">get_font_markers</a></p></td><td valign=top><p>  Returns a reference to the font map.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_color_effects.html">get_color_effects</a></p></td><td valign=top><p>  Returns a reference to the color effect map.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_scale_x_effects.html">get_scale_x_effects</a></p></td><td valign=top><p>  Returns a reference to the x scale effect map.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_scale_y_effects.html">get_scale_y_effects</a></p></td><td valign=top><p>  Returns a reference to the y scale effect map.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_angle_effects.html">get_angle_effects</a></p></td><td valign=top><p>  Returns a reference to the character angle effect map.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_font_for.html">get_font_for</a></p></td><td valign=top><p>  Returns an iterator to the font_marker associated with a particular glyph.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_width.html">get_width</a></p></td><td valign=top><p>  Returns the width of the entire buffer, or a sub-Range.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_height.html">get_height</a></p></td><td valign=top><p>  Returns the height of the entire buffer, or a sub-Range.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_size.html">get_size</a></p></td><td valign=top><p>  Returns the size of the entire buffer, or a sub-Range.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_angle.html">get_angle</a></p></td><td valign=top><p>  Returns current angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_scale.html">get_scale</a></p></td><td valign=top><p>  Returns scale for x and y.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_alignment.html">get_alignment</a></p></td><td valign=top><p>  Returns translation hotspot for the entire glyph field.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_rotation_hotspot.html">get_rotation_hotspot</a></p></td><td valign=top><p>  Returns rotation hotspot for the entire glyph field.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__bounding_rect.html">bounding_rect</a></p></td><td valign=top><p>  Returns the area that would be drawn to if a draw were performed.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__internal_rect.html">internal_rect</a></p></td><td valign=top><p>  Returns the area occupied by glyphs inside the glyph buffer's coordinate space.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_lines.html">get_lines</a></p></td><td valign=top><p>  Returns a vector of CL_GlyphBuffer::Range, each of which contains one line.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__get_line.html">get_line</a></p></td><td valign=top><p>  Returns a single CL_GlyphBuffer::Range containing the line that contains a given glyph.</p></td></tr></table>
<p><b>Operations</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__add.html">add</a></p></td><td valign=top><p>  Add elements onto the end of the glyphs vector.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__remove.html">remove</a></p></td><td valign=top><p>  Removes an element or elements from the glyphs vector, reorganizes the font and effect maps to compensate.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__change_font.html">change_font</a></p></td><td valign=top><p>  Adds a font change marker, set to occur before the next glyph/location you add is drawn.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__clear.html">clear</a></p></td><td valign=top><p>  Remove all the character position and font marker data in the buffer.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__draw.html">draw</a></p></td><td valign=top><p>  Draw the glyphs in the buffer.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__fixed_draw.html">fixed_draw</a></p></td><td valign=top><p>  Draws the glyphs in the buffer without bounding rect alignment.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__justify_left.html">justify_left</a></p></td><td valign=top><p>  Rejustifies lines in the GlyphBuffer to the left.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__justify_center.html">justify_center</a></p></td><td valign=top><p>  Rejustifies lines in the GlyphBuffer to the center.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__justify_right.html">justify_right</a></p></td><td valign=top><p>  Rejustifies lines in the GlyphBuffer to the right.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__set_angle.html">set_angle</a></p></td><td valign=top><p>  Set absolute rotation angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__rotate.html">rotate</a></p></td><td valign=top><p>  Add angle to current angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__set_scale.html">set_scale</a></p></td><td valign=top><p>  Set scale for x and y directions individually.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__set_alignment.html">set_alignment</a></p></td><td valign=top><p>  Sets translation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_GlyphBuffer__set_rotation_hotspot.html">set_rotation_hotspot</a></p></td><td valign=top><p>  Sets rotation hotspot.</p></td></tr></table>
<a name="#description"><p><b>Detailed description:</b></p>
  !group=Display/Fonts!
  !header=display.h!
  <p>CL_GlyphBuffer is mostly useful for text effects, for concatenating
  multiple CL_Font or CL_TextStyler draw_to_gb()s, or for
  when you need access to the low-level glyph positioning data. You can
  also use it to save time by only rendering a bit of text once when you need
  to, for example, both draw that text and know its bounding rectangle. But
  for optimiziation purposes alone when dealing with unchanging text, you
  should instead
  have CL_Font or CL_TextStyler render onto a CL_Canvas or CL_Surface.</p>
  <p>A glyph buffer consists of a series of characters and positions,
  and markers for font changes and various other text-altering infomration. The internal data structures used
  are made accessible and mutable externally. CL_Font
  and CL_TextStyler both have draw_to_gb() methods, which allows them to
  put data into a CL_GlyphBuffer rather than drawing to a CL_GraphicContext. </p>
  <p>The effect maps for color, angle, and scale allow you to affect those properties
  for individual glyphs during drawing and bounding rect calculation. The angle and scale maps are different
  from the GlyphBuffer angle and scale properties; the properties apply to the entire CL_GlyphBuffer as a whole, while entries
  in the effect maps affect individual glyphs seperately. It's not legal to insert
  an effect map entry for a glyph that doesn't exist.</p>
  <p>Unlike scale effects map entries, which are multiplied by the CL_Font's existing scale, 
  color effect map entries entirely override the CL_Font's color. No blending between
  the two colors is performed. Also, it's your responsibility to make sure that CL_Fonts have the right
  blending functions.</p>
  <p>In functions that calculate the size or bounding rectangle of the GlyphBuffer
  (such as bouding_rect(), get_size(), and the alignment calculations within draw),
  effect properties do take effect on the final rectangle, but GlyphBuffer rotation
  and scaling (set with CL_GlyphBuffer::set_angle(), and CL_GlyphBuffer::set_scale(),
  respectively) do not. This is consistent with the behavior of CL_Sprite and CL_Surface; the content
  affects bounding rect calculation, but the other properties of the object
  do not.</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 -->