29#include <TGUI/String.hpp>
30#include <TGUI/Rect.hpp>
78 Font(std::nullptr_t =
nullptr);
104 Font(
const void* data, std::size_t sizeInBytes);
113 Font(std::shared_ptr<BackendFont> backendFont,
const String&
id);
129 operator bool()
const;
171 FontGlyph getGlyph(
char32_t codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0)
const;
188 float getKerning(
char32_t first,
char32_t second,
unsigned int characterSize,
bool bold =
false)
const;
235 std::shared_ptr<BackendFont> m_backendFont;
bool operator==(std::nullptr_t) const
Compares the font with a nullptr.
float getLineSpacing(unsigned int characterSize) const
Returns the line spacing.
bool operator==(const Font &right) const
Compares the font with another one.
static void setGlobalFont(const Font &font)
Changes the global font that is used for all new widgets.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
Font(std::shared_ptr< BackendFont > backendFont, const String &id)
Constructor to create the font from an internal backend font.
bool operator!=(std::nullptr_t) const
Compares the font with a nullptr.
static Font getGlobalFont()
Returns the global font that is used for all new widgets.
float getKerning(char32_t first, char32_t second, unsigned int characterSize, bool bold=false) const
Returns the kerning offset of two glyphs.
Font(std::nullptr_t=nullptr)
Default constructor which will set the font to nullptr.
std::shared_ptr< BackendFont > getBackendFont() const
Returns the internal font.
const String & getId() const
Returns the id that was used to load the font.
Font(const void *data, std::size_t sizeInBytes)
Constructor to create the font from a byte array.
Font(const char *id)
Constructor to create the font from a string (filename by default)
void setSmooth(bool smooth)
Enable or disable the smooth filter.
Font(const String &id)
Constructor to create the font from a string (filename by default)
bool operator!=(const Font &right) const
Compares the font with another one.
FontGlyph getGlyph(char32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) const
Retrieve a glyph of the font.
Wrapper class to store strings.
Definition: String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
Information about a glyph in the font.
Definition: Font.hpp:47
FloatRect bounds
Bounding rectangle of the glyph, in coordinates relative to the baseline.
Definition: Font.hpp:49
IntRect textureRect
Texture coordinates of the glyph inside the font's texture.
Definition: Font.hpp:50