Class TextConfig
Configuration options for rendering text.
Implements
Inherited Members
Namespace: OpenSvg.Config
Assembly: OpenSvg.dll
Syntax
public record TextConfig : IEquatable<TextConfig>
Constructors
| Edit this page View SourceTextConfig()
Creates a new TextConfig with default values.
Declaration
public TextConfig()
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 SourceDefaultFontSize
The default font size used for rendering text.
Declaration
public static float DefaultFontSize
Field Value
| Type | Description |
|---|---|
| float |
Properties
| Edit this page View SourceDrawConfig
The configuration of the pen for drawing text, including StrokeWidth, FillColor, and StrokeColor
Declaration
public DrawConfig DrawConfig { get; init; }
Property Value
| Type | Description |
|---|---|
| DrawConfig |
FontName
Gets the name of the font.
Declaration
public string FontName { get; }
Property Value
| Type | Description |
|---|---|
| string |
FontSize
The font size of the text.
Declaration
public float FontSize { get; init; }
Property Value
| Type | Description |
|---|---|
| float |
SvgFont
The font to be used for rendering the text.
Declaration
public SvgFont SvgFont { get; init; }
Property Value
| Type | Description |
|---|---|
| SvgFont |
Text
The text to be displayed.
Declaration
public string Text { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceToSvgPath()
Converts the TextConfig object to a SvgPath object.
Declaration
public SvgPath ToSvgPath()
Returns
| Type | Description |
|---|---|
| SvgPath | A new SvgPath object. |
ToSvgText()
Converts the TextConfig object to a SvgText object.
Declaration
public SvgText ToSvgText()
Returns
| Type | Description |
|---|---|
| SvgText | A new SvgText object. |
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. |
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. |