▚ASCIIFont
Display ASCII art text with different font styles. Render large decorative text directly in the terminal.
$ termino ascii-demo
██████╗ ██████╗ ███████╗███╗ ██╗████████╗██╗ ██╗██╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██║ ██║██║
██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║██║
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║╚═╝
╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ╚██████╔╝██╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝
fonts block · bubble · banner · standard · slant · small
█▓▒░ shade glyphs supported·●●●●
##Renderable API
1import { ASCIIFontRenderable, ASCIIFontStyles, createCliRenderer } from "@opentui/core"23const renderer = await createCliRenderer()45const font = new ASCIIFontRenderable(renderer, {6id: "logo",7content: "OPENTUI",8fontStyle: ASCIIFontStyles.block,9fg: "#7dcfff",10})1112renderer.root.add(font)
##Construct API
1import { ASCIIFont, ASCIIFontStyles, createCliRenderer } from "@opentui/core"23const renderer = await createCliRenderer()45renderer.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
1// Combine with attributes2const font = new ASCIIFontRenderable(renderer, {3id: "logo",4content: "TERMINAL",5fontStyle: ASCIIFontStyles.slant,6fg: "#f7768e",7bg: "#1a1b26",8attributes: TextAttributes.BOLD,9})
##Properties
properties
| prop | type | default | description |
|---|---|---|---|
| content | string | "" | Text to render as ASCII art |
| fontStyle | ASCIIFontStyles | block | Font style for the glyphs |
| fg | string | RGBA | "#FFFFFF" | Foreground color |
| bg | string | RGBA | transparent | Background color |
| attributes | TextAttributes | 0 | Text styling attributes |