Skip to content

ui::TextLayoutOptions

Header: winui/render/TextLayout.hpp.

How TextLayout::layout() breaks and aligns lines: the paragraph-level settings a TextControl or RichText passes down.

Field Type Default
max_width float 0.0f The width lines break at, and the width alignment works in. 0 or less, or infinity, is unbounded: no line breaks but the hard ones, and lines aligned within the widest.
wrapping TextWrapping TextWrapping::NoWrap Whether and how lines break at max_width; NoWrap keeps only the hard breaks.
alignment TextAlignment TextAlignment::Left Where each line sits across the width.
base_style TextStyle The style an empty paragraph (or one with no runs) takes its line height from.