termino

ASCIIFont

Display ASCII art text with different font styles. Render large decorative text directly in the terminal.

~/components/ascii-font
live
$ termino ascii-demo
██████╗ ██████╗ ███████╗███╗ ██╗████████╗██╗ ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██║ ██║██║
██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║██║
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║╚═╝
╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ╚██████╔╝██╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝
fonts block · bubble · banner · standard · slant · small
shade glyphs supported·

##Renderable API

tsrenderable
1import { ASCIIFontRenderable, ASCIIFontStyles, createCliRenderer } from "@opentui/core"
2
3const renderer = await createCliRenderer()
4
5const font = new ASCIIFontRenderable(renderer, {
6id: "logo",
7content: "OPENTUI",
8fontStyle: ASCIIFontStyles.block,
9fg: "#7dcfff",
10})
11
12renderer.root.add(font)

##Construct API

tsconstruct
1import { ASCIIFont, ASCIIFontStyles, createCliRenderer } from "@opentui/core"
2
3const renderer = await createCliRenderer()
4
5renderer.root.add(
6ASCIIFont({
7 content: "OPENTUI",
8 fontStyle: ASCIIFontStyles.block,
9 fg: "#bb9af7",
10}),
11)

##Font styles

Available styles:

| Style | Look | | --- | --- | | ASCIIFontStyles.block | Heavy filled blocks | | ASCIIFontStyles.bubble | Outline circles | | ASCIIFontStyles.banner | Double-stroke banner | | ASCIIFontStyles.standard | Standard figlet | | ASCIIFontStyles.slant | Slanted italic | | ASCIIFontStyles.small | Compact single-line |

##Styling

ts
1// Combine with attributes
2const font = new ASCIIFontRenderable(renderer, {
3id: "logo",
4content: "TERMINAL",
5fontStyle: ASCIIFontStyles.slant,
6fg: "#f7768e",
7bg: "#1a1b26",
8attributes: TextAttributes.BOLD,
9})

##Properties

properties
proptypedefaultdescription
contentstring""Text to render as ASCII art
fontStyleASCIIFontStylesblockFont style for the glyphs
fgstring | RGBA"#FFFFFF"Foreground color
bgstring | RGBAtransparentBackground color
attributesTextAttributes0Text styling attributes