Warning
This page refers to an old version of SFML. Click here to switch to the latest version.
Warning
This page refers to an old version of SFML. Click here to switch to the latest version.
Font is the low-level class for loading and manipulating character fonts. More...
#include <SFML/Graphics/Font.hpp>
Public Member Functions | |
| Font () | |
| Default constructor. | |
| bool | LoadFromFile (const std::string &Filename, unsigned int CharSize=30, const Unicode::Text &Charset=ourDefaultCharset) |
| Load the font from a file. | |
| bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes, unsigned int CharSize=30, const Unicode::Text &Charset=ourDefaultCharset) |
| Load the font from a file in memory. | |
| unsigned int | GetCharacterSize () const |
| Get the base size of characters in the font; All glyphs dimensions are based on this value. | |
| const Glyph & | GetGlyph (Uint32 CodePoint) const |
| Get the description of a glyph (character) given by its unicode value. | |
| const Image & | GetImage () const |
| Get the image containing the rendered characters (glyphs). | |
Static Public Member Functions | |
| static const Font & | GetDefaultFont () |
| Get the SFML default built-in font (Arial). | |
Font is the low-level class for loading and manipulating character fonts.
This class is meant to be used by sf::String
| sf::Font::Font | ( | ) |
Default constructor.
| unsigned int sf::Font::GetCharacterSize | ( | ) | const |
Get the base size of characters in the font; All glyphs dimensions are based on this value.
|
static |
Get the SFML default built-in font (Arial).
| const Glyph & sf::Font::GetGlyph | ( | Uint32 | CodePoint | ) | const |
| const Image & sf::Font::GetImage | ( | ) | const |
Get the image containing the rendered characters (glyphs).
| bool sf::Font::LoadFromFile | ( | const std::string & | Filename, |
| unsigned int | CharSize = 30, | ||
| const Unicode::Text & | Charset = ourDefaultCharset ) |
Load the font from a file.
| Filename | : Font file to load |
| CharSize | : Size of characters in bitmap - the bigger, the higher quality (30 by default) |
| Charset | : Characters set to generate (by default, contains the ISO-8859-1 printable characters) |
| bool sf::Font::LoadFromMemory | ( | const char * | Data, |
| std::size_t | SizeInBytes, | ||
| unsigned int | CharSize = 30, | ||
| const Unicode::Text & | Charset = ourDefaultCharset ) |
Load the font from a file in memory.
| Data | : Pointer to the data to load |
| SizeInBytes | : Size of the data, in bytes |
| CharSize | : Size of characters in bitmap - the bigger, the higher quality (30 by default) |
| Charset | : Characters set to generate (by default, contains the ISO-8859-1 printable characters) |