Table of Contents

Class TextOptions

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Provides configuration options for rendering and shaping text.

public class TextOptions
Inheritance
TextOptions
Derived
Inherited Members

Constructors

TextOptions(Font)

Initializes a new instance of the TextOptions class.

public TextOptions(Font font)

Parameters

font Font

The font.

TextOptions(TextOptions)

Initializes a new instance of the TextOptions class from properties copied from the given instance.

public TextOptions(TextOptions options)

Parameters

options TextOptions

The options whose properties are copied into this instance.

Properties

ColorFontSupport

Gets or sets the color font support options.

public ColorFontSupport ColorFontSupport { get; set; }

Property Value

ColorFontSupport

CustomEllipsis

Gets or sets the ellipsis marker to use when TextEllipsis is Custom.

public CodePoint? CustomEllipsis { get; set; }

Property Value

CodePoint?

CustomHyphen

Gets or sets the hyphenation marker to use when TextHyphenation is Custom.

public CodePoint? CustomHyphen { get; set; }

Property Value

CodePoint?

DecorationPositioningMode

Gets or sets the positioning mode used for rendering decorations.

public DecorationPositioningMode DecorationPositioningMode { get; set; }

Property Value

DecorationPositioningMode

Dpi

Gets or sets the DPI (Dots Per Inch) to render/measure the text at.

Defaults to 72F.

public float Dpi { get; set; }

Property Value

float

FallbackFontFamilies

Gets or sets the collection of fallback font families to use when a specific glyph is missing from Font.

public IReadOnlyList<FontFamily> FallbackFontFamilies { get; set; }

Property Value

IReadOnlyList<FontFamily>

FeatureTags

Gets or sets the collection of additional feature tags to apply during glyph shaping.

public IReadOnlyList<Tag> FeatureTags { get; set; }

Property Value

IReadOnlyList<Tag>

Font

Gets or sets the font.

public Font Font { get; set; }

Property Value

Font

HintingMode

Gets or sets a value indicating whether to apply hinting - The use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid.

public HintingMode HintingMode { get; set; }

Property Value

HintingMode

HorizontalAlignment

Gets or sets the horizontal alignment of the text box.

public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

KerningMode

Gets or sets the kerning mode indicating whether to apply kerning (character spacing adjustments) to the glyph positions from information found within the font.

public KerningMode KerningMode { get; set; }

Property Value

KerningMode

LayoutMode

Gets or sets the layout mode for the text lines.

public LayoutMode LayoutMode { get; set; }

Property Value

LayoutMode

LineSpacing

Gets or sets the line spacing. Applied as a multiple of the line height.

Defaults to 1F.

public float LineSpacing { get; set; }

Property Value

float

MaxLines

Gets or sets the maximum number of lines to lay out.

public int MaxLines { get; set; }

Property Value

int

Remarks

If value is -1 then the number of lines is unlimited.

Origin

Gets or sets the rendering origin.

public Vector2 Origin { get; set; }

Property Value

Vector2

TabWidth

Gets or sets the width of the tab. Measured as the distance in spaces (U+0020).

public float TabWidth { get; set; }

Property Value

float

Remarks

If value is -1 then the font default tab width is used.

TextAlignment

Gets or sets the text alignment of the text within the box.

public TextAlignment TextAlignment { get; set; }

Property Value

TextAlignment

TextBidiMode

Gets or sets how bidirectional text is resolved.

public TextBidiMode TextBidiMode { get; set; }

Property Value

TextBidiMode

TextDirection

Gets or sets the text direction.

public TextDirection TextDirection { get; set; }

Property Value

TextDirection

TextEllipsis

Gets or sets the ellipsis behavior to use when laid-out text is limited to a maximum number of lines.

public TextEllipsis TextEllipsis { get; set; }

Property Value

TextEllipsis

TextHyphenation

Gets or sets the hyphenation marker behavior to use when text breaks at hyphenation opportunities.

public TextHyphenation TextHyphenation { get; set; }

Property Value

TextHyphenation

TextInteractionMode

Gets or sets how caret movement and selection model trailing breaking whitespace.

public TextInteractionMode TextInteractionMode { get; set; }

Property Value

TextInteractionMode

TextJustification

Gets or sets the justification of the text within the box.

public TextJustification TextJustification { get; set; }

Property Value

TextJustification

TextRuns

Gets or sets an optional collection of text runs to apply to the body of text.

public IReadOnlyList<TextRun> TextRuns { get; set; }

Property Value

IReadOnlyList<TextRun>

Tracking

Gets or sets the tracking (letter-spacing) value. Tracking adjusts the spacing between all characters uniformly and is measured in em. Positive values increase spacing, negative values decrease spacing, and zero applies no adjustment.

public float Tracking { get; set; }

Property Value

float

VerticalAlignment

Gets or sets the vertical alignment of the text box.

public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

WordBreaking

Gets or sets the word breaking mode to use when wrapping text.

public WordBreaking WordBreaking { get; set; }

Property Value

WordBreaking

WrappingLength

Gets or sets the length in pixel units (px) at which text will automatically wrap onto a new line. This property also affects the width or height (depending on the LayoutMode) of the text box for alignment of text.

public float WrappingLength { get; set; }

Property Value

float

Remarks

If value is -1 then wrapping is disabled.