SpriteFontFile
Generated from engine/render/sprite_font_file.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
#include "engine/render/sprite_font_file.h" · namespace labrador
struct SpriteFontFile
Section titled “struct SpriteFontFile”A .spritefont, taken apart into the half that is engine data and the half that needs a device.
THE FILE IS A GLYPH TABLE WITH A TEXTURE STUCK ON THE END, which is why reading it is not a backend's job even though what comes out of it is half a texture. MakeSpriteFont writes a magic, the glyphs, the line spacing, a default character and then an atlas as raw bytes and a DXGI_FORMAT - and every one of those but the last two lines is arithmetic this engine owns (font.h). Parsing it in the backend would mean every backend parsing it, and disagreeing about it silently.
IT LIVES IN render/ AND NOT IN assets/, which is where files are read, because its caller is the resource factory (engine/render/resource_factory.cpp) and nothing may point at assets - and because a file reader belongs beside the module that decides what a glyph is, which is this one.
THE PIXELS ARE A COPY AND THE STRUCT IS RETURNED BY VALUE. This is a load path, it runs once per font, and an atlas is a few tens of kilobytes; a span into a buffer the caller has to keep alive would be three lines faster and a lifetime rule nobody would read.
glyphs · line_spacing
Section titled “glyphs · line_spacing”float line_spacing = 0.0f;stand_in
Section titled “stand_in”char32_t stand_in = 0;The character the font would like drawn in place of one it lacks, or 0 for "no opinion" - which is what MakeSpriteFont writes when nobody chooses, and therefore what every .spritefont in this tree says.
The atlas, in the same shape a .dds comes out in - one level, since the format has no way to carry a chain. Sharing the type with the other reader is what lets the backend have one function that turns bytes into a texture rather than one per file kind.
read_sprite_font_file
Section titled “read_sprite_font_file”Reads the .spritefont at path.
Throws std::out_of_range naming the path if there is no file there, and std::runtime_error naming the path AND what is wrong with it if there is one and it is not a .spritefont this engine can read (T6). One throw for both has a font that exists and is corrupt report itself as missing.
Related types
Section titled “Related types”Named in the public declarations above: Glyph, TextureData.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
tests/render/sprite_font_file_tests.cpp
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.