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
FamilystringFont family name (falls back to the system font if missing).
SizefloatSize in DIPs.
WeightFontWeightWeight.
ItalicboolItalic style.
AlignHorizontalAlignmentHorizontal alignment inside the layout rectangle.
VerticalAlignVerticalAlignmentVertical alignment inside the layout rectangle.
WrapboolWraps on word boundaries when
true, single line otherwise.EllipsisboolTrims overflowing text with "…" when
true.
Properties
Align
Horizontal alignment inside the layout rectangle.
public HorizontalAlignment Align { get; init; }
Property Value
Default
Default UI text.
public static TextStyle Default { get; }
Property Value
Ellipsis
Trims overflowing text with "…" when true.
public bool Ellipsis { get; init; }
Property Value
Family
Font family name (falls back to the system font if missing).
public string Family { get; init; }
Property Value
Italic
Italic style.
public bool Italic { get; init; }
Property Value
Size
Size in DIPs.
public float Size { get; init; }
Property Value
VerticalAlign
Vertical alignment inside the layout rectangle.
public VerticalAlignment VerticalAlign { get; init; }
Property Value
Weight
Weight.
public FontWeight Weight { get; init; }
Property Value
Wrap
Wraps on word boundaries when true, single line otherwise.
public bool Wrap { get; init; }
Property Value
Methods
Bold()
Returns a bold variant.
public TextStyle Bold()
Returns
Centered()
Returns a centered variant.
public TextStyle Centered()
Returns
WithSize(float)
Returns a variant with another size.
public TextStyle WithSize(float size)
Parameters
sizefloat