Table of Contents

Class TextStyle

Namespace
PluginUI
Assembly
PluginUI.dll

Text appearance and layout options. Instances are immutable; use with to derive variants.

public sealed record TextStyle : IEquatable<TextStyle>
Inheritance
TextStyle
Implements
Inherited Members

Constructors

TextStyle(string, float, FontWeight, bool, HorizontalAlignment, VerticalAlignment, bool, bool)

Text appearance and layout options. Instances are immutable; use with to derive variants.

public TextStyle(string Family = "Segoe UI", float Size = 12, FontWeight Weight = FontWeight.Normal, bool Italic = false, HorizontalAlignment Align = HorizontalAlignment.Left, VerticalAlignment VerticalAlign = VerticalAlignment.Center, bool Wrap = false, bool Ellipsis = true)

Parameters

Family string

Font family name (falls back to the system font if missing).

Size float

Size in DIPs.

Weight FontWeight

Weight.

Italic bool

Italic style.

Align HorizontalAlignment

Horizontal alignment inside the layout rectangle.

VerticalAlign VerticalAlignment

Vertical alignment inside the layout rectangle.

Wrap bool

Wraps on word boundaries when true, single line otherwise.

Ellipsis bool

Trims overflowing text with "…" when true.

Properties

Align

Horizontal alignment inside the layout rectangle.

public HorizontalAlignment Align { get; init; }

Property Value

HorizontalAlignment

Default

Default UI text.

public static TextStyle Default { get; }

Property Value

TextStyle

Ellipsis

Trims overflowing text with "…" when true.

public bool Ellipsis { get; init; }

Property Value

bool

Family

Font family name (falls back to the system font if missing).

public string Family { get; init; }

Property Value

string

Italic

Italic style.

public bool Italic { get; init; }

Property Value

bool

Size

Size in DIPs.

public float Size { get; init; }

Property Value

float

VerticalAlign

Vertical alignment inside the layout rectangle.

public VerticalAlignment VerticalAlign { get; init; }

Property Value

VerticalAlignment

Weight

Weight.

public FontWeight Weight { get; init; }

Property Value

FontWeight

Wrap

Wraps on word boundaries when true, single line otherwise.

public bool Wrap { get; init; }

Property Value

bool

Methods

Bold()

Returns a bold variant.

public TextStyle Bold()

Returns

TextStyle

Centered()

Returns a centered variant.

public TextStyle Centered()

Returns

TextStyle

WithSize(float)

Returns a variant with another size.

public TextStyle WithSize(float size)

Parameters

size float

Returns

TextStyle