Struct AsciiFont

Inheritance Relationships

Base Type

Struct Documentation

struct AsciiFont : public CE::Text::Legacy::Font

Declaration: final

Baked ASCII glyph quads, advances, and alpha atlas.

Layout reads immutable metrics, so published text commands can share a font without changing it.

Public Functions

explicit AsciiFont(AsciiFontData data)
~AsciiFont() override = default
virtual std::vector<GlyphPlacement> layout(std::string_view text, LayoutOptions options = LayoutOptions{}) const override

Declaration: [[nodiscard]]

inline const CE::Rendering::Geometry::Buffer2D &glyph_geometry() const

Declaration: [[nodiscard]]

inline const CE::Rendering::Resources::Image &glyph_atlas() const

Declaration: [[nodiscard]]

template<typename SubmitGlyph>
inline void for_each_glyph(std::string_view text, SubmitGlyph &&submit) const

Public Static Functions

static AsciiFontData load_font(const std::filesystem::path &font_path, int font_size, CE::Rendering::Resources::Provider &provider)

Declaration: [[nodiscard]]

Bake printable ASCII from a caller-supplied font file at a positive font_size in pixels.

Upload obeys provider affinity; failure returns no data and publishes no cache entry. System discovery is optional; bundled fonts use this same path. The first face is selected for a collection.