|
| Font (std::nullptr_t=nullptr) |
| Default constructor which will set the font to nullptr.
|
|
| Font (const std::string &id) |
| Constructor to create the font from a string (filename by default) More...
|
|
| Font (const char *id) |
| Constructor to create the font from a string (filename by default) More...
|
|
| Font (const std::shared_ptr< sf::Font > &font) |
| Constructor to share the font directly. More...
|
|
| Font (const sf::Font &font) |
| Constructor to set a copy of your font. More...
|
|
| Font (const void *data, std::size_t sizeInBytes) |
| Constructor to create the font from a byte array. More...
|
|
const std::string & | getId () const |
| Returns the id that was used to load the font. More...
|
|
std::shared_ptr< sf::Font > | getFont () const |
| Gets the underlying SFML font. More...
|
|
| operator std::shared_ptr< sf::Font > () const |
| Gets the underlying SFML font. More...
|
|
| operator bool () const |
| Converts the font to a boolean to check if it is a nullptr of not.
|
|
bool | operator== (std::nullptr_t) const |
| Compares the font with a nullptr.
|
|
bool | operator!= (std::nullptr_t) const |
| Compares the font with a nullptr.
|
|
bool | operator== (const Font &right) const |
| Compares the font with another one.
|
|
bool | operator!= (const Font &right) const |
| Compares the font with another one.
|
|
const sf::Glyph & | getGlyph (std::uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) const |
| Retrieve a glyph of the font. More...
|
|
float | getKerning (std::uint32_t first, std::uint32_t second, unsigned int characterSize) const |
| Returns the kerning offset of two glyphs. More...
|
|
float | getLineSpacing (unsigned int characterSize) const |
| Returns the line spacing. More...
|
|
const sf::Glyph & tgui::Font::getGlyph |
( |
std::uint32_t |
codePoint, |
|
|
unsigned int |
characterSize, |
|
|
bool |
bold, |
|
|
float |
outlineThickness = 0 |
|
) |
| const |
Retrieve a glyph of the font.
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.
Be aware that using a negative value for the outline thickness will cause distorted rendering.
- Parameters
-
codePoint | Unicode code point of the character to get |
characterSize | Reference character size |
bold | Retrieve the bold version or the regular one? |
outlineThickness | Thickness of outline (when != 0 the glyph will not be filled) |
- Returns
- The glyph corresponding to codePoint and characterSize
float tgui::Font::getKerning |
( |
std::uint32_t |
first, |
|
|
std::uint32_t |
second, |
|
|
unsigned int |
characterSize |
|
) |
| const |
Returns the kerning offset of two glyphs.
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.
- Parameters
-
first | Unicode code point of the first character |
second | Unicode code point of the second character |
characterSize | Size of the characters |
- Returns
- Kerning value for first and second, in pixels