MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_layout()

MAYAFLUX_API std::shared_ptr< LayoutResult > MayaFlux::Portal::Text::create_layout ( std::string_view  text,
float  pen_x = 0.F,
float  pen_y = 0.F,
uint32_t  wrap_w = 0 
)

Lay out a UTF-8 string into screen-space glyph quads using the default atlas.

Each quad in the returned LayoutResult carries pixel-space position, atlas UV coordinates, and the Unicode codepoint that produced it. The caller may mutate the quads freely before passing them to rasterize_quads().

Parameters
textUTF-8 encoded input string.
pen_xStarting horizontal pen position in pixels.
pen_yStarting vertical pen position in pixels (baseline).
wrap_wWrap boundary in pixels. Zero disables wrapping.
Returns
LayoutResult containing quads and final pen position.
Precondition
set_default_font() must have been called successfully.

Definition at line 52 of file Text.cpp.

57{
58 return std::make_shared<LayoutResult>(lay_out(text, get_default_atlas(), pen_x, pen_y, wrap_w));
59}
LayoutResult lay_out(std::string_view text, GlyphAtlas &atlas, float pen_x, float pen_y, uint32_t wrap_w)
Lay out a UTF-8 string into a sequence of screen-space quads.
Definition TypeSetter.cpp:9
GlyphAtlas & get_default_atlas()
Return the default GlyphAtlas, or nullptr if set_default_font() has not been called successfully.
Definition Text.cpp:105

References get_default_atlas(), and lay_out().

+ Here is the call graph for this function: