30#include "GraphicsApi.h"
35#ifndef DOXYGEN_SHOULD_SKIP_THIS
202 const Glyph&
getGlyph(
char32_t codepoint,
unsigned characterSize,
float outlineThickness = 0.0f);
219 float getKerning(
char32_t left,
char32_t right,
unsigned characterSize);
265 std::map<uint64_t, Glyph> glyphs;
270 GlyphCache createCache();
271 Glyph createGlyph(
char32_t codepoint,
unsigned characterSize,
float outlineThickness, GlyphCache& cache);
273 bool setCurrentCharacterSize(
unsigned characterSize);
279 unsigned m_currentCharacterSize;
280 std::map<unsigned, GlyphCache> m_cache;
283#ifndef DOXYGEN_SHOULD_SKIP_THIS
A texture with a single alpha channel.
Definition: Texture.h:427
A character font.
Definition: Font.h:109
Font(Span< const uint8_t > content)
Load the font from a file in memory.
void generateTexture(unsigned characterSize)
Generate the texture for a given character size.
const Glyph & getGlyph(char32_t codepoint, unsigned characterSize, float outlineThickness=0.0f)
Retrieve a glyph of the font.
Font(const Font &)=delete
Deleted copy constructor.
float getKerning(char32_t left, char32_t right, unsigned characterSize)
Get the kerning offset of two glyphs.
Font()
Default constructor.
float getLineSpacing(unsigned characterSize)
Get the line spacing.
Font(const Path &filename)
Load the font from a file.
Font & operator=(const Font &)=delete
Deleted copy assignement.
Font & operator=(Font &&other) noexcept
Move assignement.
const AlphaTexture * getTexture(unsigned characterSize)
Retrieve the texture containing the loaded glyphs of a certain size.
Font(Font &&other) noexcept
Move constructor.
Font(InputStream &stream)
Load the font from a custom stream.
std::filesystem::path Path
A path in the filesystem.
Definition: Path.h:40
The namespace for gf classes.
A glyph.
Definition: Font.h:57
RectF textureRect
Texture coordinates of the glyph inside the font's texture.
Definition: Font.h:59
RectF bounds
Bouding rectangle of the glyph, in coordinates relative to the baseline.
Definition: Font.h:58