Class TextOptions
Provides configuration options for rendering and shaping text.
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public class TextOptions
Constructors
| Edit this page View SourceTextOptions(Font)
Initializes a new instance of the TextOptions class.
Declaration
public TextOptions(Font font)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The font. |
TextOptions(TextOptions)
Initializes a new instance of the TextOptions class from properties copied from the given instance.
Declaration
public TextOptions(TextOptions options)
Parameters
Type | Name | Description |
---|---|---|
TextOptions | options | The options whose properties are copied into this instance. |
Properties
| Edit this page View SourceColorFontSupport
Gets or sets a value indicating whether to enable various color font formats.
Declaration
public ColorFontSupport ColorFontSupport { get; set; }
Property Value
Type | Description |
---|---|
ColorFontSupport |
Dpi
Gets or sets the DPI (Dots Per Inch) to render/measure the text at.
Defaults to 72.Declaration
public float Dpi { get; set; }
Property Value
Type | Description |
---|---|
float |
FallbackFontFamilies
Gets or sets the collection of fallback font families to use when a specific glyph is missing from Font.
Declaration
public IReadOnlyList<FontFamily> FallbackFontFamilies { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyList<FontFamily> |
FeatureTags
Gets or sets the collection of additional feature tags to apply during glyph shaping.
Declaration
public IReadOnlyList<Tag> FeatureTags { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Tag> |
Font
Gets or sets the font.
Declaration
public Font Font { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public HintingMode HintingMode { get; set; }
Property Value
Type | Description |
---|---|
HintingMode |
HorizontalAlignment
Gets or sets the horizontal alignment of the text box.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public KerningMode KerningMode { get; set; }
Property Value
Type | Description |
---|---|
KerningMode |
LayoutMode
Gets or sets the layout mode for the text lines.
Declaration
public LayoutMode LayoutMode { get; set; }
Property Value
Type | Description |
---|---|
LayoutMode |
LineSpacing
Gets or sets the line spacing. Applied as a multiple of the line height.
Defaults to 1.Declaration
public float LineSpacing { get; set; }
Property Value
Type | Description |
---|---|
float |
Origin
Gets or sets the rendering origin.
Declaration
public Vector2 Origin { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
TabWidth
Gets or sets the width of the tab. Measured as the distance in spaces (U+0020).
Declaration
public float TabWidth { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public TextAlignment TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
TextAlignment |
TextDirection
Gets or sets the text direction.
Declaration
public TextDirection TextDirection { get; set; }
Property Value
Type | Description |
---|---|
TextDirection |
TextJustification
Gets or sets the justification of the text within the box.
Declaration
public TextJustification TextJustification { get; set; }
Property Value
Type | Description |
---|---|
TextJustification |
TextRuns
Gets or sets an optional collection of text runs to apply to the body of text.
Declaration
public IReadOnlyList<TextRun> TextRuns { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyList<TextRun> |
VerticalAlignment
Gets or sets the vertical alignment of the text box.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
VerticalAlignment |
WordBreaking
Gets or sets the word breaking mode to use when wrapping text.
Declaration
public WordBreaking WordBreaking { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public float WrappingLength { get; set; }
Property Value
Type | Description |
---|---|
float |
Remarks
If value is -1 then wrapping is disabled.