Back to top OpenSVG (c) Veridict AB, www.veridict.com
Edit this page

Class TextConfig

Configuration options for rendering text.

Inheritance
object
TextConfig
Implements
IEquatable<TextConfig>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenSvg.Config
Assembly: OpenSvg.dll
Syntax
public record TextConfig : IEquatable<TextConfig>

Constructors

| Edit this page View Source

TextConfig()

Creates a new TextConfig with default values.

Declaration
public TextConfig()
| Edit this page View Source

TextConfig(string, SvgFont, float, DrawConfig)

Configuration options for rendering text.

Declaration
public TextConfig(string Text, SvgFont SvgFont, float FontSize, DrawConfig DrawConfig)
Parameters
Type Name Description
string Text

The text to be displayed.

SvgFont SvgFont

The font to be used for rendering the text.

float FontSize

The font size of the text.

DrawConfig DrawConfig

The configuration of the pen for drawing text, including StrokeWidth, FillColor, and StrokeColor

Fields

| Edit this page View Source

DefaultFontSize

The default font size used for rendering text.

Declaration
public static float DefaultFontSize
Field Value
Type Description
float

Properties

| Edit this page View Source

DrawConfig

The configuration of the pen for drawing text, including StrokeWidth, FillColor, and StrokeColor

Declaration
public DrawConfig DrawConfig { get; init; }
Property Value
Type Description
DrawConfig
| Edit this page View Source

FontName

Gets the name of the font.

Declaration
public string FontName { get; }
Property Value
Type Description
string
| Edit this page View Source

FontSize

The font size of the text.

Declaration
public float FontSize { get; init; }
Property Value
Type Description
float
| Edit this page View Source

SvgFont

The font to be used for rendering the text.

Declaration
public SvgFont SvgFont { get; init; }
Property Value
Type Description
SvgFont
| Edit this page View Source

Text

The text to be displayed.

Declaration
public string Text { get; init; }
Property Value
Type Description
string

Methods

| Edit this page View Source

ToSvgPath()

Converts the TextConfig object to a SvgPath object.

Declaration
public SvgPath ToSvgPath()
Returns
Type Description
SvgPath

A new SvgPath object.

| Edit this page View Source

ToSvgText()

Converts the TextConfig object to a SvgText object.

Declaration
public SvgText ToSvgText()
Returns
Type Description
SvgText

A new SvgText object.

| Edit this page View Source

WithText(string)

Creates a new TextConfig object with the specified text.

Declaration
public TextConfig WithText(string text)
Parameters
Type Name Description
string text

The text for the new TextConfig.

Returns
Type Description
TextConfig

A new TextConfig object with the specified text.

| Edit this page View Source

WithTextColor(SKColor)

Creates a new TextConfig object with the specified color.

Declaration
public TextConfig WithTextColor(SKColor textColor)
Parameters
Type Name Description
SKColor textColor

The color for the new TextConfig.

Returns
Type Description
TextConfig

A new TextConfig object with the specified color.

Implements

IEquatable<T>