28#include <TGUI/String.hpp>
29#include <TGUI/Rect.hpp>
74 Font(std::nullptr_t =
nullptr) noexcept;
95 Font(const
void* data, std::
size_t sizeInBytes);
115 operator
bool() const;
120 TGUI_NODISCARD
bool operator==(std::nullptr_t) const;
125 TGUI_NODISCARD
bool operator!=(std::nullptr_t) const;
130 TGUI_NODISCARD
bool operator==(const
Font& right) const;
135 TGUI_NODISCARD
bool operator!=(const
Font& right) const;
150 TGUI_NODISCARD
FontGlyph getGlyph(
char32_t codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0) const;
166 TGUI_NODISCARD
float getKerning(
char32_t first,
char32_t second,
unsigned int characterSize,
bool bold = false) const;
Base class for font implementations that depend on the backend.
Definition BackendFont.hpp:43
float getFontHeight(unsigned int characterSize) const
Returns the height required to render a line of text.
float getLineSpacing(unsigned int characterSize) const
Returns the line spacing.
Font(std::nullptr_t=nullptr) noexcept
Default constructor which will set the font to nullptr.
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.
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.
std::shared_ptr< BackendFont > getBackendFont() const
Returns the internal font.
const String & getId() const
Returns the id that was used to load the font.
void setSmooth(bool smooth)
Enable or disable the smooth filter.
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:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
Information about a glyph in the font.
Definition Font.hpp:46
FloatRect bounds
Bounding rectangle of the glyph, in coordinates relative to the baseline.
Definition Font.hpp:48
UIntRect textureRect
Texture coordinates of the glyph inside the font's texture.
Definition Font.hpp:49
float advance
Offset to move horizontally to the next character.
Definition Font.hpp:47