Vixen
dd8b0a81
csharp
public readonly record struct TextDecoration

An element's resolved text-decoration, ready to draw.

Read the guide page for this →

Remarks

Resolved except for the two autos, which only a run can settle. A thickness and an underline position are the face's to state — see DecorationMetrics — and a line may be composed of runs in more than one face, so the value that reaches here is either a length the author wrote or NaN meaning "ask the font". NaN rather than zero, for TextRun.Leading's reason: zero is a thickness somebody might mean.

⚠ Color is nullable and null means currentColor. CSS's initial value for text-decoration-color is currentColor, and resolving it to the text colour here rather than at the point of drawing would mean an element that sets only text-decoration-line carries a colour it never asked for — which the animator would then happily interpolate away from.

Fields and properties (6)

  • public TextDecorationLine Lines

    Which lines to draw.

  • public TextDecorationStyle Style

    Whether each is one bar or two.

  • public Color4? Color

    What colour, or null for the text's own.

  • public float Thickness

    How thick, in pixels, or NaN for the face's.

  • public float Offset

    How much further down the underline sits, in pixels. Zero for auto.

  • public bool IsNone

    Nothing to draw. The overwhelmingly common case, and the one that must cost nothing.

Methods (1)

Used by (2)

  • DrawListBuilderVixen.Ui
  • TextRunVixen.Ui