Table of Contents

Class FigleControl

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

A control that renders text using FIGlet ASCII art fonts. Uses a custom FIGlet parser for direct rendering without Spectre.Console dependency.

public class FigleControl : BaseControl, IWindowControl, IDisposable, IDOMPaintable, INotifyPropertyChanged
Inheritance
FigleControl
Implements
Inherited Members
Extension Methods

Constructors

FigleControl()

Initializes a new instance of the FigleControl class.

public FigleControl()

Properties

Color

Gets or sets the color of the FIGlet text.

public Color? Color { get; set; }

Property Value

Color?

ContentWidth

Gets the minimum width needed to display the control's content, including margins. Returns null if width cannot be determined. This is calculated based on content (text length, child controls, etc.) and represents the natural/intrinsic size.

public override int? ContentWidth { get; }

Property Value

int?

CustomFont

Gets or sets a custom FigletFont. Takes precedence over Size.

public FigletFont? CustomFont { get; set; }

Property Value

FigletFont

FontPath

Gets or sets the name of a custom .flf font file (without extension). The font must be located in the 'fonts' directory relative to the application base directory. Takes precedence over Size but lower than CustomFont.

public string? FontPath { get; set; }

Property Value

string

RightPadded

Gets or sets whether the right side should be padded.

public bool RightPadded { get; set; }

Property Value

bool

Size

Gets or sets the FIGlet text size (uses embedded fonts).

public FigletSize Size { get; set; }

Property Value

FigletSize

Text

Gets or sets the text to render as FIGlet ASCII art.

public string? Text { get; set; }

Property Value

string

WrapMode

Gets or sets the wrap mode for FIGlet text when it exceeds available width.

public WrapMode WrapMode { get; set; }

Property Value

WrapMode

Methods

GetLogicalContentSize()

Gets the logical size of the control's content without rendering.

public override Size GetLogicalContentSize()

Returns

Size

The size representing the content's natural dimensions.

MeasureDOM(LayoutConstraints)

Measures the control's desired size given the available constraints.

public override LayoutSize MeasureDOM(LayoutConstraints constraints)

Parameters

constraints LayoutConstraints

The layout constraints (min/max width/height).

Returns

LayoutSize

The desired size of the control.

PaintDOM(CharacterBuffer, LayoutRect, LayoutRect, Color, Color)

Paints the control's content directly to a CharacterBuffer.

public override void PaintDOM(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, Color defaultFg, Color defaultBg)

Parameters

buffer CharacterBuffer

The buffer to paint to.

bounds LayoutRect

The absolute bounds where the control should paint.

clipRect LayoutRect

The clipping rectangle (visible area).

defaultFg Color
defaultBg Color

SetColor(Color)

Sets the color of the FIGlet text.

public void SetColor(Color color)

Parameters

color Color

The color to apply to the text.

SetText(string)

Sets the text to render as FIGlet ASCII art.

public void SetText(string text)

Parameters

text string

The text to display.