FigletText
IFigletText renders a string in oversized ASCII-art letters - the classic FIGlet effect, suitable for splash screens, banners, and big "DONE!" moments.
When to use
- Boot banners and CLI splash screens.
- Section headers in interactive tools.
- Anywhere a regular Markup line is too understated.
Basic usage
pascal
AnsiConsole.Write(
Widgets.FigletText('Hello Delphi')
.WithColor(TAnsiColor.Aqua)
.WithAlignment(TAlignment.Left));1
2
3
4
2
3
4
That renders something like:
_ _ _ _ ____ _ _ _
| | | | ___| | | ___ | _ \ ___| |_ __ | |__ (_)
| |_| |/ _ \ | |/ _ \ | | | |/ _ \ | '_ \| '_ \| |
| _ | __/ | | (_) | | |_| | __/ | |_) | | | | |
|_| |_|\___|_|_|\___/ |____/ \___|_| .__/|_| |_|_|
|_|1
2
3
4
5
6
2
3
4
5
6
Configuration
| Method | Purpose |
|---|---|
WithColor(color) | Foreground colour for the rendered glyphs. |
WithAlignment(value) | Horizontal alignment within the available width. |
WithFont(font) | Use a different FIGlet font (a TFigletFont value). |
The default font is "Standard" (the classic FIGlet face). The library ships the Standard font built-in; loading custom .flf fonts is possible via the TFigletFont API.
API reference
Widgets.FigletText(text)— default font.Widgets.FigletText(font, text)— custom font.IFigletText— interface.- Demo:
demos/snippets/Figlet.
See also
- Markup — for normal-sized styled text.
- Colours reference.