859 lines
53 KiB
HTML
859 lines
53 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>SFML - Simple and Fast Multimedia Library</title>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
|
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="search/search.css" />
|
|
<link rel="stylesheet" type="text/css" href="searchOverrides.css" />
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_search(); });
|
|
/* @license-end */
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">SFML 3.0.0</span>
|
|
</div>
|
|
</div>
|
|
<div id="content">
|
|
<div>
|
|
<!-- Generated by Doxygen 1.12.0 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="topics.html"><span>Topics</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){ initResizable(false); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespacesf.html">sf</a></li><li class="navelem"><a class="el" href="classsf_1_1Font.html">Font</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div id="doc-content">
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Classes</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classsf_1_1Font-members.html">List of all members</a> </div>
|
|
<div class="headertitle"><div class="title">sf::Font Class Reference<div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Class for loading and manipulating character fonts.
|
|
<a href="#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Font_8hpp_source.html">SFML/Graphics/Font.hpp</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
|
Classes</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsf_1_1Font_1_1Info.html">Info</a></td></tr>
|
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Holds various information about a font. <a href="structsf_1_1Font_1_1Info.html#details">More...</a><br /></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:ae63f472497a676ff6dee6b73e30921e7" id="r_ae63f472497a676ff6dee6b73e30921e7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae63f472497a676ff6dee6b73e30921e7">Font</a> ()=default</td></tr>
|
|
<tr class="memdesc:ae63f472497a676ff6dee6b73e30921e7"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br /></td></tr>
|
|
<tr class="separator:ae63f472497a676ff6dee6b73e30921e7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a77841b6392ac862455b7933df9a28274" id="r_a77841b6392ac862455b7933df9a28274"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a77841b6392ac862455b7933df9a28274">Font</a> (const std::filesystem::path &filename)</td></tr>
|
|
<tr class="memdesc:a77841b6392ac862455b7933df9a28274"><td class="mdescLeft"> </td><td class="mdescRight">Construct the font from a file. <br /></td></tr>
|
|
<tr class="separator:a77841b6392ac862455b7933df9a28274"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a79605392b672795f0929e0d8a3c6b0c5" id="r_a79605392b672795f0929e0d8a3c6b0c5"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a79605392b672795f0929e0d8a3c6b0c5">Font</a> (const void *data, std::size_t sizeInBytes)</td></tr>
|
|
<tr class="memdesc:a79605392b672795f0929e0d8a3c6b0c5"><td class="mdescLeft"> </td><td class="mdescRight">Construct the font from a file in memory. <br /></td></tr>
|
|
<tr class="separator:a79605392b672795f0929e0d8a3c6b0c5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6f5ee9a3fad34886c58e78b7feb4addc" id="r_a6f5ee9a3fad34886c58e78b7feb4addc"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6f5ee9a3fad34886c58e78b7feb4addc">Font</a> (<a class="el" href="classsf_1_1InputStream.html">InputStream</a> &stream)</td></tr>
|
|
<tr class="memdesc:a6f5ee9a3fad34886c58e78b7feb4addc"><td class="mdescLeft"> </td><td class="mdescRight">Construct the font from a custom stream. <br /></td></tr>
|
|
<tr class="separator:a6f5ee9a3fad34886c58e78b7feb4addc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aef926ed551d52cf35b79161791c38254" id="r_aef926ed551d52cf35b79161791c38254"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#aef926ed551d52cf35b79161791c38254">openFromFile</a> (const std::filesystem::path &filename)</td></tr>
|
|
<tr class="memdesc:aef926ed551d52cf35b79161791c38254"><td class="mdescLeft"> </td><td class="mdescRight">Open the font from a file. <br /></td></tr>
|
|
<tr class="separator:aef926ed551d52cf35b79161791c38254"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a148b67c336afc5c80d18328542719b08" id="r_a148b67c336afc5c80d18328542719b08"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a148b67c336afc5c80d18328542719b08">openFromMemory</a> (const void *data, std::size_t sizeInBytes)</td></tr>
|
|
<tr class="memdesc:a148b67c336afc5c80d18328542719b08"><td class="mdescLeft"> </td><td class="mdescRight">Open the font from a file in memory. <br /></td></tr>
|
|
<tr class="separator:a148b67c336afc5c80d18328542719b08"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac9ed783dfa17f461614a167efebe654e" id="r_ac9ed783dfa17f461614a167efebe654e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ac9ed783dfa17f461614a167efebe654e">openFromStream</a> (<a class="el" href="classsf_1_1InputStream.html">InputStream</a> &stream)</td></tr>
|
|
<tr class="memdesc:ac9ed783dfa17f461614a167efebe654e"><td class="mdescLeft"> </td><td class="mdescRight">Open the font from a custom stream. <br /></td></tr>
|
|
<tr class="separator:ac9ed783dfa17f461614a167efebe654e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a86f7a72943c428cac8fa6adaaa69c722" id="r_a86f7a72943c428cac8fa6adaaa69c722"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structsf_1_1Font_1_1Info.html">Info</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="#a86f7a72943c428cac8fa6adaaa69c722">getInfo</a> () const</td></tr>
|
|
<tr class="memdesc:a86f7a72943c428cac8fa6adaaa69c722"><td class="mdescLeft"> </td><td class="mdescRight">Get the font information. <br /></td></tr>
|
|
<tr class="separator:a86f7a72943c428cac8fa6adaaa69c722"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9f49163495c3c12bc188f60255d52501" id="r_a9f49163495c3c12bc188f60255d52501"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structsf_1_1Glyph.html">Glyph</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="#a9f49163495c3c12bc188f60255d52501">getGlyph</a> (char32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) const</td></tr>
|
|
<tr class="memdesc:a9f49163495c3c12bc188f60255d52501"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve a glyph of the font. <br /></td></tr>
|
|
<tr class="separator:a9f49163495c3c12bc188f60255d52501"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af3004df15f0db3d5420ff9e852945f18" id="r_af3004df15f0db3d5420ff9e852945f18"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#af3004df15f0db3d5420ff9e852945f18">hasGlyph</a> (char32_t codePoint) const</td></tr>
|
|
<tr class="memdesc:af3004df15f0db3d5420ff9e852945f18"><td class="mdescLeft"> </td><td class="mdescRight">Determine if this font has a glyph representing the requested code point. <br /></td></tr>
|
|
<tr class="separator:af3004df15f0db3d5420ff9e852945f18"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab92c0eb62d334b0f54dfe67d34b25e00" id="r_ab92c0eb62d334b0f54dfe67d34b25e00"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab92c0eb62d334b0f54dfe67d34b25e00">getKerning</a> (std::uint32_t first, std::uint32_t second, unsigned int characterSize, bool bold=false) const</td></tr>
|
|
<tr class="memdesc:ab92c0eb62d334b0f54dfe67d34b25e00"><td class="mdescLeft"> </td><td class="mdescRight">Get the kerning offset of two glyphs. <br /></td></tr>
|
|
<tr class="separator:ab92c0eb62d334b0f54dfe67d34b25e00"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4538cc8af337393208a87675fe1c3e59" id="r_a4538cc8af337393208a87675fe1c3e59"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#a4538cc8af337393208a87675fe1c3e59">getLineSpacing</a> (unsigned int characterSize) const</td></tr>
|
|
<tr class="memdesc:a4538cc8af337393208a87675fe1c3e59"><td class="mdescLeft"> </td><td class="mdescRight">Get the line spacing. <br /></td></tr>
|
|
<tr class="separator:a4538cc8af337393208a87675fe1c3e59"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a726a55f40c19ac108e348b103190caad" id="r_a726a55f40c19ac108e348b103190caad"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#a726a55f40c19ac108e348b103190caad">getUnderlinePosition</a> (unsigned int characterSize) const</td></tr>
|
|
<tr class="memdesc:a726a55f40c19ac108e348b103190caad"><td class="mdescLeft"> </td><td class="mdescRight">Get the position of the underline. <br /></td></tr>
|
|
<tr class="separator:a726a55f40c19ac108e348b103190caad"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad6d0a5bc6c026fe85c239f1f822b54e6" id="r_ad6d0a5bc6c026fe85c239f1f822b54e6"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad6d0a5bc6c026fe85c239f1f822b54e6">getUnderlineThickness</a> (unsigned int characterSize) const</td></tr>
|
|
<tr class="memdesc:ad6d0a5bc6c026fe85c239f1f822b54e6"><td class="mdescLeft"> </td><td class="mdescRight">Get the thickness of the underline. <br /></td></tr>
|
|
<tr class="separator:ad6d0a5bc6c026fe85c239f1f822b54e6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a649982b4d0928d76a6f45b21719a6601" id="r_a649982b4d0928d76a6f45b21719a6601"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="#a649982b4d0928d76a6f45b21719a6601">getTexture</a> (unsigned int characterSize) const</td></tr>
|
|
<tr class="memdesc:a649982b4d0928d76a6f45b21719a6601"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the texture containing the loaded glyphs of a certain size. <br /></td></tr>
|
|
<tr class="separator:a649982b4d0928d76a6f45b21719a6601"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a77b66551a75fbaf2e831571535b774aa" id="r_a77b66551a75fbaf2e831571535b774aa"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a77b66551a75fbaf2e831571535b774aa">setSmooth</a> (bool smooth)</td></tr>
|
|
<tr class="memdesc:a77b66551a75fbaf2e831571535b774aa"><td class="mdescLeft"> </td><td class="mdescRight">Enable or disable the smooth filter. <br /></td></tr>
|
|
<tr class="separator:a77b66551a75fbaf2e831571535b774aa"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae5b59162507d5dd35f3ea0ee91e322ca" id="r_ae5b59162507d5dd35f3ea0ee91e322ca"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae5b59162507d5dd35f3ea0ee91e322ca">isSmooth</a> () const</td></tr>
|
|
<tr class="memdesc:ae5b59162507d5dd35f3ea0ee91e322ca"><td class="mdescLeft"> </td><td class="mdescRight">Tell whether the smooth filter is enabled or not. <br /></td></tr>
|
|
<tr class="separator:ae5b59162507d5dd35f3ea0ee91e322ca"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Class for loading and manipulating character fonts. </p>
|
|
<p>Fonts can be opened from a file, from memory or from a custom stream, and supports the most common types of fonts.</p>
|
|
<p>See the openFromFile function for the complete list of supported formats.</p>
|
|
<p>Once it is opened, a <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> instance provides three types of information about the font: </p><ul>
|
|
<li>Global metrics, such as the line spacing </li>
|
|
<li>Per-glyph metrics, such as bounding box or kerning </li>
|
|
<li>Pixel representation of glyphs</li>
|
|
</ul>
|
|
<p>Fonts alone are not very useful: they hold the font data but cannot make anything useful of it. To do so you need to use the <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> class, which is able to properly output text with several options such as character size, style, color, position, rotation, etc. This separation allows more flexibility and better performances: indeed a <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> is a heavy resource, and any operation on it is slow (often too slow for real-time applications). On the other side, a <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> is a lightweight object which can combine the glyphs data and metrics of a <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> to display any text on a render target. Note that it is also possible to bind several <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> instances to the same <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code>.</p>
|
|
<p>It is important to note that the <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> instance doesn't copy the font that it uses, it only keeps a reference to it. Thus, a <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> must not be destructed while it is used by a <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> (i.e. never write a function that uses a local <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> instance for creating a text).</p>
|
|
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// Open a new font</span></div>
|
|
<div class="line"><span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Font.html">sf::Font</a> font(<span class="stringliteral">"arial.ttf"</span>);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="comment">// Create a text which uses our font</span></div>
|
|
<div class="line"><a class="code hl_class" href="classsf_1_1Text.html">sf::Text</a> text1(font);</div>
|
|
<div class="line">text1.setCharacterSize(30);</div>
|
|
<div class="line">text1.setStyle(<a class="code hl_enumvalue" href="classsf_1_1Text.html#aa8add4aef484c6e6b20faff07452bd82a2af9ae5e1cda126570f744448e0caa32">sf::Text::Regular</a>);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="comment">// Create another text using the same font, but with different parameters</span></div>
|
|
<div class="line"><a class="code hl_class" href="classsf_1_1Text.html">sf::Text</a> text2(font);</div>
|
|
<div class="line">text2.setCharacterSize(50);</div>
|
|
<div class="line">text2.setStyle(<a class="code hl_enumvalue" href="classsf_1_1Text.html#aa8add4aef484c6e6b20faff07452bd82aee249eb803848723c542c2062ebe69d8">sf::Text::Italic</a>);</div>
|
|
<div class="ttc" id="aclasssf_1_1Font_html"><div class="ttname"><a href="classsf_1_1Font.html">sf::Font</a></div><div class="ttdoc">Class for loading and manipulating character fonts.</div><div class="ttdef"><b>Definition</b> <a href="Font_8hpp_source.html#l00063">Font.hpp:64</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Text_html"><div class="ttname"><a href="classsf_1_1Text.html">sf::Text</a></div><div class="ttdoc">Graphical text that can be drawn to a render target.</div><div class="ttdef"><b>Definition</b> <a href="Text_8hpp_source.html#l00056">Text.hpp:57</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Text_html_aa8add4aef484c6e6b20faff07452bd82a2af9ae5e1cda126570f744448e0caa32"><div class="ttname"><a href="classsf_1_1Text.html#aa8add4aef484c6e6b20faff07452bd82a2af9ae5e1cda126570f744448e0caa32">sf::Text::Regular</a></div><div class="ttdeci">@ Regular</div><div class="ttdoc">Regular characters, no style.</div><div class="ttdef"><b>Definition</b> <a href="Text_8hpp_source.html#l00065">Text.hpp:65</a></div></div>
|
|
<div class="ttc" id="aclasssf_1_1Text_html_aa8add4aef484c6e6b20faff07452bd82aee249eb803848723c542c2062ebe69d8"><div class="ttname"><a href="classsf_1_1Text.html#aa8add4aef484c6e6b20faff07452bd82aee249eb803848723c542c2062ebe69d8">sf::Text::Italic</a></div><div class="ttdeci">@ Italic</div><div class="ttdoc">Italic characters.</div><div class="ttdef"><b>Definition</b> <a href="Text_8hpp_source.html#l00067">Text.hpp:67</a></div></div>
|
|
</div><!-- fragment --><p>Apart from opening font files, and passing them to instances of <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code>, you should normally not have to deal directly with this class. However, it may be useful to access the font metrics or rasterized glyphs for advanced usage.</p>
|
|
<p>Note that if the font is a bitmap font, it is not scalable, thus not all requested sizes will be available to use. This needs to be taken into consideration when using <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code>. If you need to display text of a certain size, make sure the corresponding bitmap font that supports that size is used.</p>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code> </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Font_8hpp_source.html#l00063">63</a> of file <a class="el" href="Font_8hpp_source.html">Font.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="ae63f472497a676ff6dee6b73e30921e7" name="ae63f472497a676ff6dee6b73e30921e7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae63f472497a676ff6dee6b73e30921e7">◆ </a></span>Font() <span class="overload">[1/4]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Font::Font </td>
|
|
<td>(</td>
|
|
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">default</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Default constructor. </p>
|
|
<p>Construct an empty font that does not contain any glyphs. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a77841b6392ac862455b7933df9a28274" name="a77841b6392ac862455b7933df9a28274"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a77841b6392ac862455b7933df9a28274">◆ </a></span>Font() <span class="overload">[2/4]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Font::Font </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::filesystem::path &</td> <td class="paramname"><span class="paramname"><em>filename</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Construct the font from a file. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. Note that this function knows nothing about the standard fonts installed on the user's system, thus you can't load them directly.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the file has to remain accessible until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">filename</td><td>Path of the font file to open</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="exception"><dt>Exceptions</dt><dd>
|
|
<table class="exception">
|
|
<tr><td class="paramname"><a class="el" href="classsf_1_1Exception.html" title="Library-specific exception type.">sf::Exception</a></td><td>if opening was unsuccessful</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#aef926ed551d52cf35b79161791c38254" title="Open the font from a file.">openFromFile</a></code>, <code><a class="el" href="#a148b67c336afc5c80d18328542719b08" title="Open the font from a file in memory.">openFromMemory</a></code>, <code><a class="el" href="#ac9ed783dfa17f461614a167efebe654e" title="Open the font from a custom stream.">openFromStream</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a79605392b672795f0929e0d8a3c6b0c5" name="a79605392b672795f0929e0d8a3c6b0c5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a79605392b672795f0929e0d8a3c6b0c5">◆ </a></span>Font() <span class="overload">[3/4]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Font::Font </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::size_t</td> <td class="paramname"><span class="paramname"><em>sizeInBytes</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Construct the font from a file in memory. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the buffer pointed by <code>data</code> has to remain valid until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">data</td><td>Pointer to the file data in memory </td></tr>
|
|
<tr><td class="paramname">sizeInBytes</td><td>Size of the data to load, in bytes</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="exception"><dt>Exceptions</dt><dd>
|
|
<table class="exception">
|
|
<tr><td class="paramname"><a class="el" href="classsf_1_1Exception.html" title="Library-specific exception type.">sf::Exception</a></td><td>if loading was unsuccessful</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#aef926ed551d52cf35b79161791c38254" title="Open the font from a file.">openFromFile</a></code>, <code><a class="el" href="#a148b67c336afc5c80d18328542719b08" title="Open the font from a file in memory.">openFromMemory</a></code>, <code><a class="el" href="#ac9ed783dfa17f461614a167efebe654e" title="Open the font from a custom stream.">openFromStream</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6f5ee9a3fad34886c58e78b7feb4addc" name="a6f5ee9a3fad34886c58e78b7feb4addc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6f5ee9a3fad34886c58e78b7feb4addc">◆ </a></span>Font() <span class="overload">[4/4]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Font::Font </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classsf_1_1InputStream.html">InputStream</a> &</td> <td class="paramname"><span class="paramname"><em>stream</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Construct the font from a custom stream. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. Warning: SFML cannot preload all the font data in this function, so the contents of <code>stream</code> have to remain valid as long as the font is used.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the stream has to remain accessible until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">stream</td><td>Source stream to read from</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="exception"><dt>Exceptions</dt><dd>
|
|
<table class="exception">
|
|
<tr><td class="paramname"><a class="el" href="classsf_1_1Exception.html" title="Library-specific exception type.">sf::Exception</a></td><td>if loading was unsuccessful</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#aef926ed551d52cf35b79161791c38254" title="Open the font from a file.">openFromFile</a></code>, <code><a class="el" href="#a148b67c336afc5c80d18328542719b08" title="Open the font from a file in memory.">openFromMemory</a></code>, <code><a class="el" href="#ac9ed783dfa17f461614a167efebe654e" title="Open the font from a custom stream.">openFromStream</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a9f49163495c3c12bc188f60255d52501" name="a9f49163495c3c12bc188f60255d52501"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9f49163495c3c12bc188f60255d52501">◆ </a></span>getGlyph()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="structsf_1_1Glyph.html">Glyph</a> & sf::Font::getGlyph </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char32_t</td> <td class="paramname"><span class="paramname"><em>codePoint</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>bold</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>outlineThickness</em></span><span class="paramdefsep"> = </span><span class="paramdefval">0</span> ) const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Retrieve a glyph of the font. </p>
|
|
<p>If the font is a bitmap font, not all character sizes might be available. If the glyph is not available at the requested size, an empty glyph is returned.</p>
|
|
<p>You may want to use <code>hasGlyph</code> to determine if the glyph exists before requesting it. If the glyph does not exist, a font specific default is returned.</p>
|
|
<p>Be aware that using a negative value for the outline thickness will cause distorted rendering.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">codePoint</td><td>Unicode code point of the character to get </td></tr>
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size </td></tr>
|
|
<tr><td class="paramname">bold</td><td>Retrieve the bold version or the regular one? </td></tr>
|
|
<tr><td class="paramname">outlineThickness</td><td>Thickness of outline (when != 0 the glyph will not be filled)</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The glyph corresponding to <code>codePoint</code> and <code>characterSize</code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a86f7a72943c428cac8fa6adaaa69c722" name="a86f7a72943c428cac8fa6adaaa69c722"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a86f7a72943c428cac8fa6adaaa69c722">◆ </a></span>getInfo()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="structsf_1_1Font_1_1Info.html">Info</a> & sf::Font::getInfo </td>
|
|
<td>(</td>
|
|
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the font information. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A structure that holds the font information </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab92c0eb62d334b0f54dfe67d34b25e00" name="ab92c0eb62d334b0f54dfe67d34b25e00"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab92c0eb62d334b0f54dfe67d34b25e00">◆ </a></span>getKerning()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">float sf::Font::getKerning </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::uint32_t</td> <td class="paramname"><span class="paramname"><em>first</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::uint32_t</td> <td class="paramname"><span class="paramname"><em>second</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>bold</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span> ) const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the kerning offset of two glyphs. </p>
|
|
<p>The kerning is an extra offset (negative) to apply between two glyphs when rendering them, to make the pair look more "natural". For example, the pair "AV" have a special kerning to make them closer than other characters. Most of the glyphs pairs have a kerning offset of zero, though.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">first</td><td>Unicode code point of the first character </td></tr>
|
|
<tr><td class="paramname">second</td><td>Unicode code point of the second character </td></tr>
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size </td></tr>
|
|
<tr><td class="paramname">bold</td><td>Retrieve the bold version or the regular one?</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Kerning value for <code>first</code> and <code>second</code>, in pixels </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4538cc8af337393208a87675fe1c3e59" name="a4538cc8af337393208a87675fe1c3e59"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4538cc8af337393208a87675fe1c3e59">◆ </a></span>getLineSpacing()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">float sf::Font::getLineSpacing </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the line spacing. </p>
|
|
<p>Line spacing is the vertical offset to apply between two consecutive lines of text.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Line spacing, in pixels </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a649982b4d0928d76a6f45b21719a6601" name="a649982b4d0928d76a6f45b21719a6601"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a649982b4d0928d76a6f45b21719a6601">◆ </a></span>getTexture()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & sf::Font::getTexture </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Retrieve the texture containing the loaded glyphs of a certain size. </p>
|
|
<p>The contents of the returned texture changes as more glyphs are requested, thus it is not very relevant. It is mainly used internally by <code><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target.">sf::Text</a></code>.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">Texture</a> containing the glyphs of the requested size </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a726a55f40c19ac108e348b103190caad" name="a726a55f40c19ac108e348b103190caad"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a726a55f40c19ac108e348b103190caad">◆ </a></span>getUnderlinePosition()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">float sf::Font::getUnderlinePosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the position of the underline. </p>
|
|
<p>Underline position is the vertical offset to apply between the baseline and the underline.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Underline position, in pixels</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#ad6d0a5bc6c026fe85c239f1f822b54e6" title="Get the thickness of the underline.">getUnderlineThickness</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad6d0a5bc6c026fe85c239f1f822b54e6" name="ad6d0a5bc6c026fe85c239f1f822b54e6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad6d0a5bc6c026fe85c239f1f822b54e6">◆ </a></span>getUnderlineThickness()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">float sf::Font::getUnderlineThickness </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int</td> <td class="paramname"><span class="paramname"><em>characterSize</em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the thickness of the underline. </p>
|
|
<p>Underline thickness is the vertical size of the underline.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">characterSize</td><td>Reference character size</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Underline thickness, in pixels</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a726a55f40c19ac108e348b103190caad" title="Get the position of the underline.">getUnderlinePosition</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af3004df15f0db3d5420ff9e852945f18" name="af3004df15f0db3d5420ff9e852945f18"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af3004df15f0db3d5420ff9e852945f18">◆ </a></span>hasGlyph()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool sf::Font::hasGlyph </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char32_t</td> <td class="paramname"><span class="paramname"><em>codePoint</em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Determine if this font has a glyph representing the requested code point. </p>
|
|
<p>Most fonts only include a very limited selection of glyphs from specific Unicode subsets, like Latin, Cyrillic, or Asian characters.</p>
|
|
<p>While code points without representation will return a font specific default character, it might be useful to verify whether specific code points are included to determine whether a font is suited to display text in a specific language.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">codePoint</td><td>Unicode code point to check</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the codepoint has a glyph representation, <code>false</code> otherwise </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae5b59162507d5dd35f3ea0ee91e322ca" name="ae5b59162507d5dd35f3ea0ee91e322ca"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae5b59162507d5dd35f3ea0ee91e322ca">◆ </a></span>isSmooth()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool sf::Font::isSmooth </td>
|
|
<td>(</td>
|
|
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Tell whether the smooth filter is enabled or not. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if smoothing is enabled, <code>false</code> if it is disabled</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a77b66551a75fbaf2e831571535b774aa" title="Enable or disable the smooth filter.">setSmooth</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aef926ed551d52cf35b79161791c38254" name="aef926ed551d52cf35b79161791c38254"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aef926ed551d52cf35b79161791c38254">◆ </a></span>openFromFile()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool sf::Font::openFromFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::filesystem::path &</td> <td class="paramname"><span class="paramname"><em>filename</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Open the font from a file. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. Note that this function knows nothing about the standard fonts installed on the user's system, thus you can't load them directly.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the file has to remain accessible until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">filename</td><td>Path of the font file to load</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if opening succeeded, <code>false</code> if it failed</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a148b67c336afc5c80d18328542719b08" title="Open the font from a file in memory.">openFromMemory</a></code>, <code><a class="el" href="#ac9ed783dfa17f461614a167efebe654e" title="Open the font from a custom stream.">openFromStream</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a148b67c336afc5c80d18328542719b08" name="a148b67c336afc5c80d18328542719b08"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a148b67c336afc5c80d18328542719b08">◆ </a></span>openFromMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool sf::Font::openFromMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::size_t</td> <td class="paramname"><span class="paramname"><em>sizeInBytes</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Open the font from a file in memory. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the buffer pointed by <code>data</code> has to remain valid until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">data</td><td>Pointer to the file data in memory </td></tr>
|
|
<tr><td class="paramname">sizeInBytes</td><td>Size of the data to load, in bytes</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if opening succeeded, <code>false</code> if it failed</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#aef926ed551d52cf35b79161791c38254" title="Open the font from a file.">openFromFile</a></code>, <code><a class="el" href="#ac9ed783dfa17f461614a167efebe654e" title="Open the font from a custom stream.">openFromStream</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac9ed783dfa17f461614a167efebe654e" name="ac9ed783dfa17f461614a167efebe654e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac9ed783dfa17f461614a167efebe654e">◆ </a></span>openFromStream()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool sf::Font::openFromStream </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classsf_1_1InputStream.html">InputStream</a> &</td> <td class="paramname"><span class="paramname"><em>stream</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Open the font from a custom stream. </p>
|
|
<p>The supported font formats are: TrueType, Type 1, CFF, OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>SFML cannot preload all the font data in this function, so the stream has to remain accessible until the <code><a class="el" href="classsf_1_1Font.html" title="Class for loading and manipulating character fonts.">sf::Font</a></code> object opens a new font or is destroyed.</dd></dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">stream</td><td>Source stream to read from</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if opening succeeded, <code>false</code> if it failed</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#aef926ed551d52cf35b79161791c38254" title="Open the font from a file.">openFromFile</a></code>, <code><a class="el" href="#a148b67c336afc5c80d18328542719b08" title="Open the font from a file in memory.">openFromMemory</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a77b66551a75fbaf2e831571535b774aa" name="a77b66551a75fbaf2e831571535b774aa"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a77b66551a75fbaf2e831571535b774aa">◆ </a></span>setSmooth()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Font::setSmooth </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>smooth</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Enable or disable the smooth filter. </p>
|
|
<p>When the filter is activated, the font appears smoother so that pixels are less noticeable. However if you want the font to look exactly the same as its source file, you should disable it. The smooth filter is enabled by default.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">smooth</td><td><code>true</code> to enable smoothing, <code>false</code> to disable it</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#ae5b59162507d5dd35f3ea0ee91e322ca" title="Tell whether the smooth filter is enabled or not.">isSmooth</a></code> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="Font_8hpp_source.html">Font.hpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br />
|
|
Copyright © Laurent Gomila ::
|
|
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|