Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > f48941b2df41f17d4c9519d16b753438 > files > 340

ClanLib06-devel-0.6.5-16.fc13.x86_64.rpm


<html>
<head><title>ClanLib Reference: CL_Font_Description</title></head>
<body text=black link=blue vlink=#800080 bgcolor=white topmargin=0 leftmargin=0>
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img border=0 src="../images/eyeheader-main-purple-a.gif" alt="ClanSoft logo" width=525 height=96></td></tr>
<tr bgcolor=#dadada><td align=left valign=top><img border=0 src="../images/eyeheader-main-purple-b.gif" alt="ClanSoft logo" width=190 height=14></td><td align=right valign=top><img border=0 src="../images/clanlib_light.gif" width=42 height=14></td></tr></table>
<table align=center border=0 cellspacing=10> <tr>
<td><a href="entire_class_index.html">Entire Class Index</a></td>
<td><a href="class_index.html">Main Class Index</a></td>
<td><a href="cross_index.html">Cross Index</a></td>
<td><a href="global_index.html">Global Index</a></td>
</table><h1 align=center>Class CL_Font_Description</h1><p>
<b>  Font provider interface.</b><br>
Contained in: <a href="global_index.html">global</a><br>
Derived from:
<i>none</i>
<br>
Derived by:
<i>none</i>
<br>Group: Display (Fonts)
<p>
#include &lt;ClanLib/display.h&gt;
<p>
<hr noshade>
<table border=0>
<tr><td colspan=3><h3>public function member index:</h3></td>
<tr valign=top><td align=left><h3>Construction:</h3></td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Font_Description.html#2119"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a></td><td><tt>(<a href="CL_InputSource.html"><tt><font color=navy><b>CL_InputSource</b></font></tt></a>* <tt><font color=blue>input</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Font_Description.html#2120"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a></td><td><tt>(<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>* <tt><font color=blue>p</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt>* <tt><font color=blue>tcols</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>num_tcols</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>spacelen</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>letters</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Font_Description.html#2121"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a></td><td><tt>(<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>* <tt><font color=blue>source</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>trans_limit</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>space_len</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>letters</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Font_Description.html#2122"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a></td><td><tt>(<tt><font color=navy>std::vector</font></tt><<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>*> <tt><font color=blue>letter_provider</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>space_len</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt><font color=navy>std::string</font></tt> <tt><font color=blue>letters</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Font_Description.html#2123"><tt><font color=blue><b>~CL_Font_Description</b></font></tt></a></td><td><tt>()</tt>;</td>
<tr valign=top><td align=left><h3>Operations:</h3></td>
<tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_Font_Description.html#2124"><tt><font color=blue><b>lock</b></font></tt></a></td><td><tt>()</tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_Font_Description.html#2125"><tt><font color=blue><b>unlock</b></font></tt></a></td><td><tt>()</tt>;</td>
<tr><td>&nbsp;</td></table>
<hr noshade>
<h2>Description:</h2>
  The font description class is used by the CL_Font" font  class to load the font.<br><br>  Currently ClanLib support two types of fonts:<br><br>  The old method.<br><br>  You may find some 256 color indexed fonts with some of ClanLib's  example applications. They use the three last colors in the palette to  seperate the letters, break the line, and to determine the size of the  font. The method is deprecated.<br><br>  The new method.<br><br>  The font description class constructs the font letters from an image  with alpha values. Each letter is seperated with transparent lines and  the font description class uses this information to determine where it so  seperate the letters.<br><br>  CL_Font_Description allows you to adjust how much transparent a line  must be before it consideres it as a letter seperator line. The  trans_limit parameter handles this.<br><br>  If your font is italic you can use the subtract_width parameter to  move the printed letters "closer to each other". This is, with a fine  word, called the kerning of the font.<br><p>
<hr noshade>
<h2>Function Member Descriptions:</h2>
<a name="2119"><font size=+1><b>CL_Font_Description::CL_Font_Description</b></font></a> -   This constructor is used to load the font from an input source.  Usually this from a resource datafile.<br> <br>  Normally you do not use this constructor directly. It is much  easier to use CL_Font::load() when retrieving a font from a  datafile.<br><tt></tt> <a href="CL_Font_Description.html#2119"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a><tt>(<a href="CL_InputSource.html"><tt><font color=navy><b>CL_InputSource</b></font></tt></a>* <tt><font color=blue>input</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2120"><font size=+1><b>CL_Font_Description::CL_Font_Description</b></font></a> -   This constructs a font description using the old font method. It  is obsolete and only provided for backward compatibility. Please  don't use it.<br><tt></tt> <a href="CL_Font_Description.html#2120"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a><tt>(<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>* <tt><font color=blue>p</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt>* <tt><font color=blue>tcols</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>num_tcols</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>spacelen</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>letters</font></tt>)</tt>;<br><blockquote>  p - Image which contain the font letters.<br>  x - Start x coordinate on top-left most font letter.<br>  y - Start y coordinate on top-left most font letter.<br>  tcols - Array of colors to be transparent.<br>  num_tcols - Number of elements in the tcols array.<br>  spacelen - Pixel width of the space character.<br>  subtract_width - Width to subtract from each letter when drawing the font (aka. font kerning).<br>  letters - String containing all the letters listed in the image file. Must be ordered in the same way as in the image file.</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2121"><font size=+1><b>CL_Font_Description::CL_Font_Description</b></font></a> -   This constructs a font description using the new alpha cutter  method.<br>  Please have a look on the class overview reference page for more  information.<br><tt></tt> <a href="CL_Font_Description.html#2121"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a><tt>(<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>* <tt><font color=blue>source</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>trans_limit</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>space_len</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>letters</font></tt>)</tt>;<br><blockquote>  source - Image which contain the font letters.<br>  trans_limit - The maximum amount of alpha allowed before a pixel is no longer considered transparent.<br>  space_len - Pixel width of the space character.<br>  subtract_width - Width to subtract from each letter when drawing the font (aka. font kerning).<br>  letters - String containing all the letters listed in the image file. Must be ordered in the same way as in the image file.</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2122"><font size=+1><b>CL_Font_Description::CL_Font_Description</b></font></a> -   This is primarily used by the TTF resource loader to handle fonts<br><tt></tt> <a href="CL_Font_Description.html#2122"><tt><font color=blue><b>CL_Font_Description</b></font></tt></a><tt>(<tt><font color=navy>std::vector</font></tt><<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>*> <tt><font color=blue>letter_provider</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>space_len</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>subtract_width</font></tt>, <tt><font color=navy>std::string</font></tt> <tt><font color=blue>letters</font></tt>)</tt>;<br><blockquote>  letters - A vector array of pointers to the letters themselves<br>  space_len - Pixel width of the space character<br>  subtract_width - Width to subtract from each letter when drawing the font (aka. font kerning).<br>  letters - String containing all the letters listed in the image file. Must be ordered in the same way as in the image file.</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2124"><font size=+1><b>CL_Font_Description::lock</b></font></a> -   Lock<br><tt><tt><font color=purple>void</font></tt></tt> <a href="CL_Font_Description.html#2124"><tt><font color=blue><b>lock</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2125"><font size=+1><b>CL_Font_Description::unlock</b></font></a> -   Unlock<br><tt><tt><font color=purple>void</font></tt></tt> <a href="CL_Font_Description.html#2125"><tt><font color=blue><b>unlock</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2123"><font size=+1><b>CL_Font_Description::~CL_Font_Description</b></font></a> -   Standard destructor for cleanup<br><tt></tt> <a href="CL_Font_Description.html#2123"><tt><font color=blue><b>~CL_Font_Description</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<hr noshade>
<h2>Variable Member Descriptions:</h2>
<a name="2115"><font size=+1><b>CL_Font_Description::letter_providers</b></font></a> -   Letter Providers<br>
<tt><tt><font color=navy>std::vector</font></tt><<a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>*> </tt> <tt><a href="CL_Font_Description.html#2115"><tt><font color=blue>letter_providers</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2118"><font size=+1><b>CL_Font_Description::letters</b></font></a> -   Letters<br>
<tt><tt><font color=navy>std::string</font></tt> </tt> <tt><a href="CL_Font_Description.html#2118"><tt><font color=blue>letters</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2116"><font size=+1><b>CL_Font_Description::space_len</b></font></a> -   Space length<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Font_Description.html#2116"><tt><font color=blue>space_len</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2117"><font size=+1><b>CL_Font_Description::subtract_width</b></font></a> -   Subtract Width<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Font_Description.html#2117"><tt><font color=blue>subtract_width</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<hr noshade>
</body>
</html>