|
bool | loadFromMemory (std::unique_ptr< std::uint8_t[]> data, std::size_t sizeInBytes) override |
| Loads a font from memory. More...
|
|
bool | hasGlyph (char32_t codePoint) const override |
| Returns whether a font contains a certain glyph. More...
|
|
FontGlyph | getGlyph (char32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) override |
| Retrieve a glyph of the font. More...
|
|
float | getKerning (char32_t first, char32_t second, unsigned int characterSize, bool bold) override |
| Returns the kerning offset of two glyphs. More...
|
|
float | getLineSpacing (unsigned int characterSize) override |
| Returns the line spacing. More...
|
|
float | getUnderlinePosition (unsigned int characterSize) override |
| Get the position of the underline. More...
|
|
float | getUnderlineThickness (unsigned int characterSize) override |
| Get the thickness of the underline. More...
|
|
std::shared_ptr< BackendTexture > | getTexture (unsigned int characterSize) override |
| Returns the texture that is used to store glyphs of the given character size. More...
|
|
void | setSmooth (bool smooth) override |
| Enable or disable the smooth filter. More...
|
|
sf::Font & | getInternalFont () |
|
virtual bool | loadFromMemory (std::unique_ptr< std::uint8_t[]> data, std::size_t sizeInBytes)=0 |
| Loads a font from memory. More...
|
|
bool | loadFromMemory (const void *data, std::size_t sizeInBytes) |
| Loads a font from memory. More...
|
|
virtual | ~BackendFont ()=default |
| Virtual destructor.
|
|
virtual bool | loadFromFile (const String &filename) |
| Loads a font from a file. More...
|
|
virtual bool | loadFromMemory (std::unique_ptr< std::uint8_t[]> data, std::size_t sizeInBytes)=0 |
| Loads a font from memory. More...
|
|
bool | loadFromMemory (const void *data, std::size_t sizeInBytes) |
| Loads a font from memory. More...
|
|
virtual bool | hasGlyph (char32_t codePoint) const =0 |
| Returns whether a font contains a certain glyph. More...
|
|
virtual FontGlyph | getGlyph (char32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0)=0 |
| Retrieve a glyph of the font. More...
|
|
virtual float | getKerning (char32_t first, char32_t second, unsigned int characterSize, bool bold)=0 |
| Returns the kerning offset of two glyphs. More...
|
|
virtual float | getLineSpacing (unsigned int characterSize)=0 |
| Returns the line spacing. More...
|
|
virtual float | getUnderlinePosition (unsigned int characterSize)=0 |
| Get the position of the underline. More...
|
|
virtual float | getUnderlineThickness (unsigned int characterSize)=0 |
| Get the thickness of the underline. More...
|
|
virtual std::shared_ptr< BackendTexture > | getTexture (unsigned int characterSize)=0 |
| Returns the texture that is used to store glyphs of the given character size. More...
|
|
virtual void | setSmooth (bool smooth) |
| Enable or disable the smooth filter. More...
|
|
bool | isSmooth () const |
| Tell whether the smooth filter is enabled or not. More...
|
|
Font implementation that makes use of SFML.
float tgui::BackendFontSFML::getKerning |
( |
char32_t |
first, |
|
|
char32_t |
second, |
|
|
unsigned int |
characterSize, |
|
|
bool |
bold |
|
) |
| |
|
overridevirtual |
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 |
bold | Are the glyphs bold or regular? |
- Returns
- Kerning value for first and second, in pixels
Implements tgui::BackendFont.