Sophie

Sophie

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

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


<!-- clanlib header begin -->
<HTML>
<HEAD>
<TITLE>CL_Font - 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_Font</h1>
<p>  Draws text using system fonts or glyph sprites. <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_Font__CL_Font.html">CL_Font</a></p></td><td valign=top><p>  Constructs a font.</p></td></tr></table>
<p><b>Attributes:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_Font__get_delims.html">get_delims</a></p></td><td valign=top><p>  Returns delimiters string.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_width_offset.html">get_width_offset</a></p></td><td valign=top><p>  Returns width offset.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_height_offset.html">get_height_offset</a></p></td><td valign=top><p>  Returns height offset.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_scale.html">get_scale</a></p></td><td valign=top><p>  Returns current scale.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_alpha.html">get_alpha</a></p></td><td valign=top><p>  Returns current alpha.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_color.html">get_color</a></p></td><td valign=top><p>  Returns current color.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_blend_func.html">get_blend_func</a></p></td><td valign=top><p>  Returns blending functions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_glyph_rot_hotspot.html">get_glyph_rot_hotspot</a></p></td><td valign=top><p>  Returns glyph rotation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_alignment.html">get_alignment</a></p></td><td valign=top><p>  Returns translation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_height.html">get_height</a></p></td><td valign=top><p>  Returns the drawn height of the entire font or a string.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_width.html">get_width</a></p></td><td valign=top><p>  Returns the drawn width of a character or string.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__get_size.html">get_size</a></p></td><td valign=top><p>  Returns the drawn size of a string.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__bounding_rect.html">bounding_rect</a></p></td><td valign=top><p>  Calculate the rectangle that would be occupied by a draw operation.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__is_glyph.html">is_glyph</a></p></td><td valign=top><p>  Returns whether or not a glyph exists for a given character</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__resource.html">resource</a></p></td><td valign=top><p>  Resource owning this font, if any.</p></td></tr></table>
<p><b>Operations:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_Font__operator =.html">operator =</a></p></td><td valign=top><p>  Copy assignment operator.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__bool.html">bool</a></p></td><td valign=top><p>  Return true if the CL_Font object is valid</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__draw.html">draw</a></p></td><td valign=top><p>  Draws text to a graphic context.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__draw_to_gb.html">draw_to_gb</a></p></td><td valign=top><p>  Inserts data into a CL_GlyphBuffer, treating the glyphs already there as part of a previous draw_to_gb().</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__draw_glyph.html">draw_glyph</a></p></td><td valign=top><p>  Draws a single glyph to a given spot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__draw_character.html">draw_character</a></p></td><td valign=top><p>  Draws a single character to a given spot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_delims.html">set_delims</a></p></td><td valign=top><p>  Sets delimiters string.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_width_offset.html">set_width_offset</a></p></td><td valign=top><p>  Sets width offset.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_height_offset.html">set_height_offset</a></p></td><td valign=top><p>  Sets height offset.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_scale.html">set_scale</a></p></td><td valign=top><p>  Sets scale for x and y directions individually.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_alpha.html">set_alpha</a></p></td><td valign=top><p>  Sets transparency.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_color.html">set_color</a></p></td><td valign=top><p>  Sets the color.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_blend_func.html">set_blend_func</a></p></td><td valign=top><p>  Sets blending functions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__set_glyph_rot_hotspot.html">set_glyph_rot_hotspot</a></p></td><td valign=top><p>  Sets glyph rotation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Font__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_Font__get_glyphs.html">get_glyphs</a></p></td><td valign=top><p></p></td></tr></table>
<a name="#description"><p><b>Detailed description:</b></p>
  !group=Display/Fonts!
  !header=display.h!
  <p>A font can be constructed either from a CL_Sprite (aka a bitmap font) or from a system
  font A bitmap font uses a CL_Sprite as the source for the font
  glyphs (letters), where each frame frame in the sprite
  represents one glyph. A string (<i>letter_chars</i>) is then
  describing which character each glyph corresponds to. If the
  sprite contains the letters ABCZXY123 in that order, then the
  string should be "ABCZXY123". A system font uses the underlaying windowing system to create
  the font glyphs. This means that in Windows you can choose any
  TTF font, and same applies to X11 if the font server supports
  it.</p>
  <p>Newlines always have a width of zero.
  Other than that, characters for which glyphs weren't specified have the width of a space.</p>
  <p>Unlike CL_Surface and CL_Sprite, scaling affects the calculation
  of any bounding rectangles (such as the result returned
  by draw(), bounding_rect(), or get_size(), or the rectangle calculated internally by
  draw() for alignment). This is because scaling
  the CL_Font is effectively just changing the point size of the glyphs,
  and that affects all sorts of things, such as word wrapping.</p>
  <p>Word wrapping works automatically whenever you pass CL_Font a destination rectangle
  or size with non-zero width. CL_Font uses the delims string (which can be changed
  using the set_delims() method)
  to determine where divisions between words are. Word wrapping does allow
  blank characters (characters for which there isn't a glyph supplied)
  to extend over the border line; this helps wrapped text to remain flush.</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 -->