29#include <TGUI/String.hpp>
30#include <TGUI/Rect.hpp>
40 class BackendFontBase;
77 Font(std::nullptr_t =
nullptr);
103 Font(
const void* data, std::size_t sizeInBytes);
112 Font(std::shared_ptr<BackendFontBase> backendFont,
const String&
id);
128 operator bool()
const;
170 FontGlyph getGlyph(
char32_t codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0)
const;
187 float getKerning(
char32_t first,
char32_t second,
unsigned int characterSize,
bool bold =
false)
const;
212 std::shared_ptr<BackendFontBase> 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 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< BackendFontBase > 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)
Font(std::shared_ptr< BackendFontBase > backendFont, const String &id)
Constructor to create the font from an internal backend font.
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