1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
|
<!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>
|