Loads font data and provides cached bitmap atlases per size.
More...
#include <spk_font.hpp>
|
| class | Bitmap |
| | Font atlas texture and glyph metadata for a specific size. More...
|
| struct | Size |
| | Defines glyph and outline sizes for a font bitmap. More...
|
|
| | Font (const std::vector< uint8_t > &p_rawData) |
| | Builds a font from raw font data.
|
| Bitmap & | bitmap (const Size &p_fontSize) |
| | Returns a bitmap atlas for the requested size.
|
|
| static Font | fromFile (const std::filesystem::path &p_path) |
| | Loads a font from file.
|
| static Font | fromRawData (const std::vector< uint8_t > &p_rawData) |
| | Loads a font from raw data.
|
Loads font data and provides cached bitmap atlases per size.
- See also
- Font::Bitmap
auto &
bitmap = font.bitmap({16, 0});
static Font fromFile(const std::filesystem::path &p_path)
Loads a font from file.
Definition spk_font.cpp:390
Bitmap & bitmap(const Size &p_fontSize)
Returns a bitmap atlas for the requested size.
Definition spk_font.cpp:400
◆ Font()
| spk::Font::Font |
( |
const std::vector< uint8_t > & | p_rawData | ) |
|
Builds a font from raw font data.
- Parameters
-
| p_rawData | Raw font file bytes. |
◆ bitmap()
Returns a bitmap atlas for the requested size.
- Parameters
-
| p_fontSize | Size of glyphs and outline. |
- Returns
- Bitmap atlas reference.
◆ fromFile()
| Font spk::Font::fromFile |
( |
const std::filesystem::path & | p_path | ) |
|
|
static |
Loads a font from file.
- Parameters
-
| p_path | Path to the font file. |
- Returns
- Loaded Font instance.
◆ fromRawData()
| Font spk::Font::fromRawData |
( |
const std::vector< uint8_t > & | p_rawData | ) |
|
|
static |
Loads a font from raw data.
- Parameters
-
| p_rawData | Raw font file bytes. |
- Returns
- Loaded Font instance.
The documentation for this class was generated from the following files:
- includes/structure/graphics/spk_font.hpp
- srcs/structure/graphics/spk_font.cpp