Function CE::Text::layout_text(const FontCollection&, std::string_view, const LayoutOptions&)

Function Documentation

ShapedText CE::Text::layout_text(const FontCollection &fonts, std::string_view text, const LayoutOptions &options = {})

Declaration: [[nodiscard]]

Shape on CPU with bidi resolution and whole-grapheme fallback; retain font bytes but not the input view.

Soft wrapping reshapes accepted lines and can break oversized words only at grapheme boundaries. Explicit CR/LF/CRLF/NEL/paragraph/line separators work; trailing ASCII spaces/tabs have no visual advance and tabs expand to four spaces. Invalid size, width, direction/language or moved-from collection rejects layout; shaping/allocation errors propagate.

See also

Text layout

Parameters:
  • fonts – Stable immutable collection retained in the returned value.

  • text – UTF-8 borrowed for the call; replacements preserve malformed source byte ranges.

  • options – Local sizing, direction, wrapping and language settings.

Returns:

Owned immutable layout ready for CPU glyph preparation, without native resources.