Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fengo

fengo logo

License Release Status Go Version Build Status

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.

Features

  • 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, and magenta.
  • 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.

Installation

From Source

Ensure you have Go installed:

go install github.com/blip-lang/fengo/cmd/fengo@latest

Or clone and build manually:

git clone https://github.com/blip-lang/fengo.git
cd fengo
go build -o fengo cmd/fengo/main.go

Pre-built Binaries

You can download pre-built binaries for Windows, macOS, and Linux from the Releases page.

Library Usage

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)
}

Try these commands!

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"

Usage

fengo [flags] <text>

Flags

  • --font: Name of a font in assets/fonts/ (e.g., mini, block, dots, slant) or a direct path to a custom .json font file. Default: mini.
  • --color: Color to apply to the output.

Available Fonts

  • mini (default): Clean, sans-serif style.
  • block: Bold, dense characters using @.
  • dots: Refined style using dots.
  • slant: Stylish slanted ASCII art.

Available Colors

red, green, yellow, blue, purple, magenta, pink, cyan, white.

Examples

# 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"

Creating Custom Fonts

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"

License

MIT

About

fengo is a lightweight, customizable ASCII art font rendering engine written in Go

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages