Struct Font

Inheritance Relationships

Base Type

Derived Types

Struct Documentation

struct Font : protected CE::Assets::Content2D

Retains glyph geometry/atlas; direct base construction does not validate them.

Immutable implementations support CPU layout without a graphics context.

Subclassed by CE::Text::Legacy::AsciiFont, CE::Text::Legacy::BitmapFont

Public Functions

inline explicit Font(const FontResources &data, std::shared_ptr<const CE::Rendering::Resources::Material> material = {})

Retain supplied geometry, atlas and optional material without validating resources.

Implementations determine metrics/encoding; callers must preserve the resource backend domain for native use.

virtual ~Font()

Release logical resource ownership; final native retirement follows the original backend rules.

virtual std::vector<GlyphPlacement> layout(std::string_view text, LayoutOptions options = LayoutOptions{}) const = 0

Declaration: [[nodiscard]]

Return owned placements without retaining the input bytes or requiring graphics calls.

Encoding, metrics and supported options belong to the concrete implementation; the interface promises no shaping.

Parameters:
  • text – Borrowed only for this call.

  • options – Legacy bank selection, where supported.

inline const std::shared_ptr<CE::Rendering::Geometry::Buffer2D> &glyph_geometry_handle() const

Declaration: [[nodiscard]]

Borrow the retained geometry handle.

Copy it to retain ownership beyond this font; native use still requires the original live backend.

inline const std::shared_ptr<CE::Rendering::Resources::Image> &glyph_atlas_handle() const

Declaration: [[nodiscard]]

Borrow the retained atlas handle; copy the handle for independent retention.

inline const std::shared_ptr<const CE::Rendering::Resources::Material> &material_handle() const

Declaration: [[nodiscard]]

Borrow the optional retained material handle.

Empty means no material was supplied to this base construction.