SceneTextSpan Class

A part of a text with its own style (SceneText.Spans): what it does not set is the style of the text. The spans are drawn one after the other on the baseline of the text, unless they are moved (SceneTextSpan.X, SceneTextSpan.Y, SceneTextSpan.Dx, SceneTextSpan.Dy, SceneTextSpan.BaselineShift).

public sealed class SceneTextSpan

Exceptions

ArgumentNullException
text is null.

Constructors

NameDescription
SceneTextSpan(string)A part of a text with its own style (SceneText.Spans): what it does not set is the style of the text. The spans are drawn one after the other on the baseline of the text, unless they are moved (SceneTextSpan.X, SceneTextSpan.Y, SceneTextSpan.Dx, SceneTextSpan.Dy, SceneTextSpan.BaselineShift).

SceneTextSpan(string)

SceneTextSpan.cs

A part of a text with its own style (SceneText.Spans): what it does not set is the style of the text. The spans are drawn one after the other on the baseline of the text, unless they are moved (SceneTextSpan.X, SceneTextSpan.Y, SceneTextSpan.Dx, SceneTextSpan.Dy, SceneTextSpan.BaselineShift).

public SceneTextSpan(string text)

Parameters

text string
The characters of the span.

Exceptions

ArgumentNullException
text is null.

Properties

NameDescription
BaselineShiftGets how far the baseline of the span is raised above the baseline of the text, in pixels, as the SVG baseline-shift property: positive for a superscript, negative for a subscript. The default is 0; a value that is not finite is 0.
ColorGets the color of the span, or null for the color of the text.
DecorationFillGets how the lines of the span are painted, or null for the paint of the lines of the text (SceneText.DecorationFill), and else the paint of the glyphs of the span.
DecorationsGets the lines drawn with the span, or null for the lines of the text.
DxGets the horizontal shift of the span, in pixels, as the dx attribute of an SVG tspan: the span and the spans that follow it move by this distance. On a path, the shift is along the path. The default is 0; a value that is not finite is 0.
DyGets the vertical shift of the span, in pixels, as the dy attribute of an SVG tspan: the baseline of the span and of the spans that follow it moves down by this distance. On a path, the shift is across the path. The default is 0; a value that is not finite is 0.
FillGets how the glyphs of the span are painted, or null for SceneTextSpan.Color when it is set, or else for the fill of the text (SceneText.Fill, then SceneText.Color).
FontGets the font of the span, or null for the font of the text.
GlyphRotationGets the rotation of each character of the span around its origin on the baseline, in degrees, clockwise, as a single value of the rotate attribute of an SVG tspan. The characters keep their advances. The default is 0; a value that is not finite is 0.
LetterSpacingGets the space added after each character of the span, or null for the spacing of the text (SceneText.LetterSpacing).
StrokeGets how the outline of the glyphs of the span is painted, or null for the outline of the text (SceneText.Stroke).
TextGets the characters of the span.
WordSpacingGets the space added to each space of the span, or null for the spacing of the text (SceneText.WordSpacing).
XGets the x coordinate the span starts at, as the x attribute of an SVG tspan, or null (the default) to start where the previous span ends.
YGets the y coordinate of the baseline of the span and of the spans that follow it, as the y attribute of an SVG tspan, or null (the default) for the baseline of the previous span.

BaselineShift

SceneTextSpan.cs

Gets how far the baseline of the span is raised above the baseline of the text, in pixels, as the SVG baseline-shift property: positive for a superscript, negative for a subscript. The default is 0; a value that is not finite is 0.

public double BaselineShift { get; init; }

Property value

double

Remarks

The shift applies to the span only: the next span is back on the baseline of the text.

Gets the color of the span, or null for the color of the text.

public SceneColor? Color { get; init; }

Property value

SceneColor?

DecorationFill

SceneTextSpan.cs

Gets how the lines of the span are painted, or null for the paint of the lines of the text (SceneText.DecorationFill), and else the paint of the glyphs of the span.

public ScenePaint? DecorationFill { get; init; }

Property value

ScenePaint?

Decorations

SceneTextSpan.cs

Gets the lines drawn with the span, or null for the lines of the text.

public SceneTextDecorations? Decorations { get; init; }

Property value

SceneTextDecorations?

Gets the horizontal shift of the span, in pixels, as the dx attribute of an SVG tspan: the span and the spans that follow it move by this distance. On a path, the shift is along the path. The default is 0; a value that is not finite is 0.

public double Dx { get; init; }

Property value

double

Gets the vertical shift of the span, in pixels, as the dy attribute of an SVG tspan: the baseline of the span and of the spans that follow it moves down by this distance. On a path, the shift is across the path. The default is 0; a value that is not finite is 0.

public double Dy { get; init; }

Property value

double

Gets how the glyphs of the span are painted, or null for SceneTextSpan.Color when it is set, or else for the fill of the text (SceneText.Fill, then SceneText.Color).

public ScenePaint? Fill { get; init; }

Property value

ScenePaint?

Gets the font of the span, or null for the font of the text.

public SceneFont? Font { get; init; }

Property value

SceneFont?

GlyphRotation

SceneTextSpan.cs

Gets the rotation of each character of the span around its origin on the baseline, in degrees, clockwise, as a single value of the rotate attribute of an SVG tspan. The characters keep their advances. The default is 0; a value that is not finite is 0.

public double GlyphRotation { get; init; }

Property value

double

Remarks

The characters of a rotated span are shaped one grapheme cluster at a time: no kerning applies between them.

LetterSpacing

SceneTextSpan.cs

Gets the space added after each character of the span, or null for the spacing of the text (SceneText.LetterSpacing).

public double? LetterSpacing { get; init; }

Property value

double?

Gets how the outline of the glyphs of the span is painted, or null for the outline of the text (SceneText.Stroke).

public ScenePaint? Stroke { get; init; }

Property value

ScenePaint?

Remarks

The width and the dashes of the outline are the ones of the text.

Gets the characters of the span.

public string Text { get; }

Property value

string

WordSpacing

SceneTextSpan.cs

Gets the space added to each space of the span, or null for the spacing of the text (SceneText.WordSpacing).

public double? WordSpacing { get; init; }

Property value

double?

Gets the x coordinate the span starts at, as the x attribute of an SVG tspan, or null (the default) to start where the previous span ends.

public double? X { get; init; }

Property value

double?

Remarks

A span with SceneTextSpan.X or SceneTextSpan.Y starts a new text chunk: the anchor of the text (SceneText.Anchor) applies to each chunk, from its first character. The spans that follow continue from the end of the span. On a path (SceneText.Path), SceneTextSpan.X and SceneTextSpan.Y are ignored. A value that is not finite is ignored.

Gets the y coordinate of the baseline of the span and of the spans that follow it, as the y attribute of an SVG tspan, or null (the default) for the baseline of the previous span.

public double? Y { get; init; }

Property value

double?

Remarks

See SceneTextSpan.X: a span with SceneTextSpan.Y starts a new text chunk.