<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>SFML - Simple and Fast Multimedia Library</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="tabs.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="logo"> <img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" /> </div> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.htm"><span>Main Page</span></a></li> <li><a href="namespaces.htm"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.htm"><span>Classes</span></a></li> <li><a href="files.htm"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.htm"><span>Class List</span></a></li> <li><a href="classes.htm"><span>Class Index</span></a></li> <li><a href="hierarchy.htm"><span>Class Hierarchy</span></a></li> <li><a href="functions.htm"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><b>sf</b>::<a class="el" href="classsf_1_1Font.htm">Font</a> </div> </div> <div class="contents"> <h1>sf::Font Class Reference</h1><!-- doxytag: class="sf::Font" --><!-- doxytag: inherits="Resource< Font >" --><a class="el" href="classsf_1_1Font.htm" title="Font is the low-level class for loading and manipulating character fonts.">Font</a> is the low-level class for loading and manipulating character fonts. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="Font_8hpp-source.htm">Font.hpp</a>></code> <p> <div class="dynheader"> Inheritance diagram for sf::Font:</div> <div class="dynsection"> <p><center><img src="classsf_1_1Font.png" usemap="#sf::Font_map" border="0" alt=""></center> <map name="sf::Font_map"> <area href="classsf_1_1Resource.htm" alt="sf::Resource< Font >" shape="rect" coords="0,0,131,24"> </map> </div> <p> <a href="classsf_1_1Font-members.htm">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#506404655b8869ed60d1e7709812f583">Font</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#506404655b8869ed60d1e7709812f583"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#c1f0de973bdb9485b5f0bf4aacb717e5">LoadFromFile</a> (const std::string &Filename, unsigned int CharSize=30, const <a class="el" href="classsf_1_1Unicode_1_1Text.htm">Unicode::Text</a> &Charset=ourDefaultCharset)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Load the font from a file. <a href="#c1f0de973bdb9485b5f0bf4aacb717e5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#ecee6a8f62a20424a803508522e3607b">LoadFromMemory</a> (const char *Data, std::size_t SizeInBytes, unsigned int CharSize=30, const <a class="el" href="classsf_1_1Unicode_1_1Text.htm">Unicode::Text</a> &Charset=ourDefaultCharset)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Load the font from a file in memory. <a href="#ecee6a8f62a20424a803508522e3607b"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#85bd25d6eac95cd20ccc2e9d17ab90bc">GetCharacterSize</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the base size of characters in the font; All glyphs dimensions are based on this value. <a href="#85bd25d6eac95cd20ccc2e9d17ab90bc"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classsf_1_1Glyph.htm">Glyph</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#044159ab533345fd030430c822cd2bd6">GetGlyph</a> (Uint32 CodePoint) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the description of a glyph (character) given by its unicode value. <a href="#044159ab533345fd030430c822cd2bd6"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classsf_1_1Image.htm">Image</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#e499022bb1bc6f8ce26096a05ab8a8e8">GetImage</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the image containing the rendered characters (glyphs). <a href="#e499022bb1bc6f8ce26096a05ab8a8e8"></a><br></td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static const <a class="el" href="classsf_1_1Font.htm">Font</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Font.htm#128c377d51263288be98565771c48e36">GetDefaultFont</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the SFML default built-in font (Arial). <a href="#128c377d51263288be98565771c48e36"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <a class="el" href="classsf_1_1Font.htm" title="Font is the low-level class for loading and manipulating character fonts.">Font</a> is the low-level class for loading and manipulating character fonts. <p> This class is meant to be used by <a class="el" href="classsf_1_1String.htm" title="String defines a graphical 2D text, that can be drawn on screen.">sf::String</a> <p>Definition at line <a class="el" href="Font_8hpp-source.htm#l00054">54</a> of file <a class="el" href="Font_8hpp-source.htm">Font.hpp</a>.</p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="506404655b8869ed60d1e7709812f583"></a><!-- doxytag: member="sf::Font::Font" ref="506404655b8869ed60d1e7709812f583" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">sf::Font::Font </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Default constructor. <p> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00064">64</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="85bd25d6eac95cd20ccc2e9d17ab90bc"></a><!-- doxytag: member="sf::Font::GetCharacterSize" ref="85bd25d6eac95cd20ccc2e9d17ab90bc" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int sf::Font::GetCharacterSize </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> Get the base size of characters in the font; All glyphs dimensions are based on this value. <p> Get the base size of characters in the font; All glyphs dimensions are based on this value.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Base size of characters </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00120">120</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <a class="anchor" name="128c377d51263288be98565771c48e36"></a><!-- doxytag: member="sf::Font::GetDefaultFont" ref="128c377d51263288be98565771c48e36" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classsf_1_1Font.htm">Font</a> & sf::Font::GetDefaultFont </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Get the SFML default built-in font (Arial). <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Instance of the default font </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00159">159</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <a class="anchor" name="044159ab533345fd030430c822cd2bd6"></a><!-- doxytag: member="sf::Font::GetGlyph" ref="044159ab533345fd030430c822cd2bd6" args="(Uint32 CodePoint) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classsf_1_1Glyph.htm">Glyph</a> & sf::Font::GetGlyph </td> <td>(</td> <td class="paramtype">Uint32 </td> <td class="paramname"> <em>CodePoint</em> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> Get the description of a glyph (character) given by its unicode value. <p> Get the description of a glyph (character) given by its unicode value.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>CodePoint</em> </td><td>: <a class="el" href="classsf_1_1Unicode.htm" title="Provides utility functions to convert from and to any unicode and ASCII encoding...">Unicode</a> value of the character to get</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Glyph's visual settings, or an invalid glyph if character not found </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00130">130</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <a class="anchor" name="e499022bb1bc6f8ce26096a05ab8a8e8"></a><!-- doxytag: member="sf::Font::GetImage" ref="e499022bb1bc6f8ce26096a05ab8a8e8" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classsf_1_1Image.htm">Image</a> & sf::Font::GetImage </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> Get the image containing the rendered characters (glyphs). <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="classsf_1_1Image.htm" title="Image is the low-level class for loading and manipulating images.">Image</a> containing glyphs </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00150">150</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <a class="anchor" name="c1f0de973bdb9485b5f0bf4aacb717e5"></a><!-- doxytag: member="sf::Font::LoadFromFile" ref="c1f0de973bdb9485b5f0bf4aacb717e5" args="(const std::string &Filename, unsigned int CharSize=30, const Unicode::Text &Charset=ourDefaultCharset)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool sf::Font::LoadFromFile </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>Filename</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>CharSize</em> = <code>30</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classsf_1_1Unicode_1_1Text.htm">Unicode::Text</a> & </td> <td class="paramname"> <em>Charset</em> = <code>ourDefaultCharset</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Load the font from a file. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>Filename</em> </td><td>: <a class="el" href="classsf_1_1Font.htm" title="Font is the low-level class for loading and manipulating character fonts.">Font</a> file to load </td></tr> <tr><td valign="top"></td><td valign="top"><em>CharSize</em> </td><td>: Size of characters in bitmap - the bigger, the higher quality (30 by default) </td></tr> <tr><td valign="top"></td><td valign="top"><em>Charset</em> </td><td>: Characters set to generate (by default, contains the ISO-8859-1 printable characters)</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True if loading was successful </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00074">74</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <a class="anchor" name="ecee6a8f62a20424a803508522e3607b"></a><!-- doxytag: member="sf::Font::LoadFromMemory" ref="ecee6a8f62a20424a803508522e3607b" args="(const char *Data, std::size_t SizeInBytes, unsigned int CharSize=30, const Unicode::Text &Charset=ourDefaultCharset)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool sf::Font::LoadFromMemory </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>Data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t </td> <td class="paramname"> <em>SizeInBytes</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"> <em>CharSize</em> = <code>30</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classsf_1_1Unicode_1_1Text.htm">Unicode::Text</a> & </td> <td class="paramname"> <em>Charset</em> = <code>ourDefaultCharset</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Load the font from a file in memory. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>Data</em> </td><td>: Pointer to the data to load </td></tr> <tr><td valign="top"></td><td valign="top"><em>SizeInBytes</em> </td><td>: Size of the data, in bytes </td></tr> <tr><td valign="top"></td><td valign="top"><em>CharSize</em> </td><td>: Size of characters in bitmap - the bigger, the higher quality (30 by default) </td></tr> <tr><td valign="top"></td><td valign="top"><em>Charset</em> </td><td>: Characters set to generate (by default, contains the ISO-8859-1 printable characters)</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True if loading was successful </dd></dl> <p>Definition at line <a class="el" href="Font_8cpp-source.htm#l00093">93</a> of file <a class="el" href="Font_8cpp-source.htm">Font.cpp</a>.</p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="Font_8hpp-source.htm">Font.hpp</a><li><a class="el" href="Font_8cpp-source.htm">Font.cpp</a></ul> </div> <p id="footer"> :: Copyright © 2007-2008 Laurent Gomila, all rights reserved :: Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> :: </p> </body> </html>