Skip to content

FigletTextWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Displays large ASCII-art ("FIGlet") text rendered from a .

csharp
public sealed record FigletTextWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<FigletTextWidget>

Inheritance

ObjectHex1bWidgetFigletTextWidget

Implements

Constructors

FigletTextWidget(string)

Displays large ASCII-art ("FIGlet") text rendered from a .

Parameters:

  • Text (String): The text to render. May contain newline characters which force vertical breaks.
csharp
public FigletTextWidget(string Text)

Properties

Font

The font used to render . Defaults to .

Returns: FigletFont

csharp
public FigletFont Font { get; init; }

HorizontalLayout

Horizontal layout mode. defers to the font's preference.

Returns: FigletLayoutMode

csharp
public FigletLayoutMode HorizontalLayout { get; init; }

HorizontalOverflow

How to handle horizontal overflow. Defaults to .

Returns: FigletHorizontalOverflow

csharp
public FigletHorizontalOverflow HorizontalOverflow { get; init; }

Text

The text to render. May contain newline characters which force vertical breaks.

Returns: String

csharp
public string Text { get; init; }

VerticalLayout

Vertical layout mode. defers to the font's preference.

Returns: FigletLayoutMode

csharp
public FigletLayoutMode VerticalLayout { get; init; }

VerticalOverflow

How to handle vertical overflow. Defaults to .

Returns: FigletVerticalOverflow

csharp
public FigletVerticalOverflow VerticalOverflow { get; init; }

Remarks

FIGlet text is composed of glyphs whose height is determined by the font. The widget honors the font's preferred horizontal and vertical layout modes by default but the caller can override either axis via , , or .

To pick a font, use one of the bundled instances on (for example FigletFonts.Slant) or load a custom .flf file via .

FIGlet text is rendered monochrome — apply colors and animations by wrapping the widget in an EffectPanel, which colorizes surface cells without affecting layout.

Examples

csharp
using Hex1b;
using Hex1b.Widgets;

await using var terminal = Hex1bTerminal.CreateBuilder()
    .WithHex1bApp((app, options) => ctx =>
        ctx.FigletText("Hello").Font(FigletFonts.Slant))
    .Build();

await terminal.RunAsync();

Released under the MIT License.