Back to API Reference
Struct

LayoutSettings

sealed

Configuration for text layout and positioning.

Remarks

Used by TextLayout to control how text is positioned within the available bounds. Includes settings for maximum dimensions, spacing, and alignment.
public static LayoutSettings Default{ get }

Gets the default layout settings with unlimited dimensions, top vertical alignment and start horizontal alignment.

public float maxWidth

Maximum width for text layout. Use FloatMax for unlimited.

public float maxHeight

Maximum height for text layout. Use FloatMax for unlimited.

public float lineSpacing

Additional spacing between lines (can be negative).

public float defaultLineHeight

Fallback line height when font metrics are unavailable.

public HorizontalAlignment horizontalAlignment

Horizontal text alignment within the layout bounds.

public VerticalAlignment verticalAlignment

Vertical text alignment within the layout bounds.

public TextJustify textJustify

How extra space is distributed when horizontalAlignment is Justify. Ignored otherwise.

public LastLineAlignment lastLineAlignment

How the paragraph-terminating line is aligned when horizontalAlignment is Justify. Ignored otherwise.

public float justifyWordSpaceMin

Smallest word-separator width justification compression may reach, as a fraction of natural width.

public float justifyWordSpaceMax

Largest word-separator width justification expansion spends before the letter and glyph levers engage, as a fraction of natural width. Residual expansion beyond every budget still lands on word separators.

public float justifyLetterSpaceMin

Largest letter-spacing reduction justification compression may spend, in em (non-positive).

public float justifyLetterSpaceMax

Largest letter-spacing addition justification expansion may spend, in em (non-negative).

public float justifyGlyphScaleMin

Smallest glyph-width fraction justification compression may reach; 1 disables the glyph lever.

public float justifyGlyphScaleMax

Largest glyph-width fraction justification expansion may reach; 1 disables the glyph lever.

public TextOverEdge overEdge

Top edge metric for text box trimming.

public TextUnderEdge underEdge

Bottom edge metric for text box trimming.

public LeadingDistribution leadingDistribution

How extra leading from line-height is distributed relative to the content area.

public bool measureTrailingWhitespace

Whether trailing spaces and tabs participate in alignment and reported extents without changing line breaking.

public LineHeightMode lineHeightMode

How each line's height is determined relative to the fonts it contains.

public float lineHeightScale

Line height as a multiple of font size when lineHeightMode is Scaled. Ignored otherwise.

public static LineHeightMode DefaultLineHeightMode

Project-wide default line-height mode seeded into Default. Mirrored from DefaultLineHeightMode and pushed from the main thread, so worker-thread layout reads it without touching Resources.

public static float DefaultLineHeightScale

Project-wide default line-height scale seeded into Default. Mirrored from LineHeightScale.