26#ifndef TGUI_BACKEND_FONT_SFML_HPP
27#define TGUI_BACKEND_FONT_SFML_HPP
29#include <TGUI/Backend/Font/BackendFont.hpp>
30#include <SFML/Graphics/Font.hpp>
31#include <unordered_set>
54 bool loadFromMemory(std::unique_ptr<std::uint8_t[]> data, std::size_t sizeInBytes)
override;
65 bool hasGlyph(
char32_t codePoint)
const override;
81 FontGlyph getGlyph(
char32_t codePoint,
unsigned int characterSize,
bool bold,
float outlineThickness = 0)
override;
98 float getKerning(
char32_t first,
char32_t second,
unsigned int characterSize,
bool bold)
override;
144 std::shared_ptr<BackendTexture>
getTexture(
unsigned int characterSize)
override;
164 sf::Font& getInternalFont();
171 std::unique_ptr<std::uint8_t[]> m_fileContents;
173 std::unordered_set<std::uint64_t> m_loadedGlyphKeys;
177 std::map<unsigned int, std::shared_ptr<BackendTexture>> m_textures;
Font implementation that makes use of SFML.
Definition: BackendFontSFML.hpp:43
float getUnderlinePosition(unsigned int characterSize) override
Get the position of the underline.
bool hasGlyph(char32_t codePoint) const override
Returns whether a font contains a certain glyph.
FontGlyph getGlyph(char32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness=0) override
Retrieve a glyph of the font.
std::shared_ptr< BackendTexture > getTexture(unsigned int characterSize) override
Returns the texture that is used to store glyphs of the given character size.
float getUnderlineThickness(unsigned int characterSize) override
Get the thickness of the underline.
bool loadFromMemory(std::unique_ptr< std::uint8_t[]> data, std::size_t sizeInBytes) override
Loads a font from memory.
void setSmooth(bool smooth) override
Enable or disable the smooth filter.
float getLineSpacing(unsigned int characterSize) override
Returns the line spacing.
float getKerning(char32_t first, char32_t second, unsigned int characterSize, bool bold) override
Returns the kerning offset of two glyphs.
Base class for font implementations that depend on the backend.
Definition: BackendFont.hpp:43
virtual bool loadFromMemory(std::unique_ptr< std::uint8_t[]> data, std::size_t sizeInBytes)=0
Loads a font from memory.
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
Information about a glyph in the font.
Definition: Font.hpp:47