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
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
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
RightPadded
Gets or sets whether the right side should be padded.
public bool RightPadded { get; set; }
Property Value
Size
Gets or sets the FIGlet text size (uses embedded fonts).
public FigletSize Size { get; set; }
Property Value
Text
Gets or sets the text to render as FIGlet ASCII art.
public string? Text { get; set; }
Property Value
WrapMode
Gets or sets the wrap mode for FIGlet text when it exceeds available width.
public WrapMode WrapMode { get; set; }
Property Value
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
constraintsLayoutConstraintsThe 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
bufferCharacterBufferThe buffer to paint to.
boundsLayoutRectThe absolute bounds where the control should paint.
clipRectLayoutRectThe clipping rectangle (visible area).
defaultFgColordefaultBgColor
SetColor(Color)
Sets the color of the FIGlet text.
public void SetColor(Color color)
Parameters
colorColorThe color to apply to the text.
SetText(string)
Sets the text to render as FIGlet ASCII art.
public void SetText(string text)
Parameters
textstringThe text to display.