fengo is a lightweight, customizable ASCII art font rendering engine written in Go. It is designed to be simple, secure, and easily extensible with your own JSON-based font formats.
- Custom JSON Fonts: Define your own fonts in a simple JSON format.
- Improved Resolution: High-quality 5-line height fonts for better readability.
- Color Support: Built-in support for standard ANSI colors including
pink,cyan, andmagenta. - Case Insensitivity: Automatically falls back to uppercase if lowercase characters are missing in the font file.
- Multi-line Support: Renders multi-line strings correctly.
- Zero Dependencies: Uses only the Go standard library for core logic.
Ensure you have Go installed:
go install github.com/blip-lang/fengo/cmd/fengo@latestOr clone and build manually:
git clone https://github.com/blip-lang/fengo.git
cd fengo
go build -o fengo cmd/fengo/main.goYou can download pre-built binaries for Windows, macOS, and Linux from the Releases page.
You can also use fengo as a library in your own Go projects.
package main
import (
"fmt"
"github.com/blip-lang/fengo/pkg/font"
"github.com/blip-lang/fengo/pkg/render"
)
func main() {
// Load font from a file
f, _ := font.Load("path/to/font.json")
// Render with options
output := render.Render("Hello", f, &render.Options{
Color: "cyan",
})
fmt.Println(output)
}After building the binary (go build -o fengo cmd/fengo/main.go), try these out:
# Classic Slant
./fengo --font slant --color blue "FENGO"
# Bold Block
./fengo --font block --color red "DANGER"
# Minimalist Dots
./fengo --font dots --color purple "STYLISH"
# Small but clear
./fengo --font mini --color green "SUCCESS"
# Multi-line input (using \n)
./fengo --font slant "LINE ONE\nLINE TWO"fengo [flags] <text>--font: Name of a font inassets/fonts/(e.g.,mini,block,dots,slant) or a direct path to a custom.jsonfont file. Default:mini.--color: Color to apply to the output.
mini(default): Clean, sans-serif style.block: Bold, dense characters using@.dots: Refined style using dots.slant: Stylish slanted ASCII art.
red, green, yellow, blue, purple, magenta, pink, cyan, white.
# Render with default font
fengo "Hello"
# Render with slant font in cyan
fengo --font slant --color cyan "Fengo"
# Render with block font in green
fengo --font block --color green "Success"Fonts are simple JSON files. Create a file (e.g., myfont.json) with the following structure:
{
"name": "myfont",
"height": 5,
"characters": {
"A": [
" A ",
" A A ",
"AAAAA",
"A A",
"A A"
],
" ": [
" ",
" ",
" ",
" ",
" "
]
}
}Then use it with:
fengo --font ./myfont.json "AAA"MIT
