Features β’ Quick Start β’ Installation β’ Usage β’ Library β’ Font Collection β’ Contributing β’ License β’ Acknowledgments
| Feature | Description |
|---|---|
| π 100+ Font Styles | Classic terminal, retro gaming, modern pixel, decorative, and monospace fonts. All free for commercial and personal use. |
| π€ Multi-Format Export | Export to TXT, Go, JavaScript, Python, Rust, and Bash with language-specific formatting. |
| π¨ Advanced Text Effects | Color gradient effects (horizontal & vertical), shadow effects (horizontal & vertical), and text scaling (0.5Γβ4Γ). |
| π Rich Color Support | 14 vibrant predefined UI colors that can be combined with gradients. The library and CLI also accept any hex color for unlimited possibilities. |
| π Alignment & Spacing | Adjust character, word, and line spacing. Align text left, center, or right. |
| β‘οΈ Smart Typography | Automatic kerning, descender detection and alignment. |
| π οΈ Powerful CLI Tool | Render text quickly with extended options for fonts, colors, spacing, and effects. |
| π Standalone Go Library | A simple, self-contained API with type-safe enums for effortless programmatic ANSI text rendering. |
# 1. Clone the repository
git clone https://github.com/superstarryeyes/bit
cd bit
# 2. Install dependencies
go mod tidy
# 3. Build the interactive UI
go build -o bit ./cmd/bit
# 4. Start creating!
./bit- Go 1.25+ - Required for proper module support
# Clone repository
git clone https://github.com/superstarryeyes/bit
cd bit
# Install dependencies
go mod tidy
# Build the interactive UI (includes embedded fonts)
go build -o bit ./cmd/bit
# Build the command line tool
go build -o ansifonts-cli ./cmd/ansifontsNote
Fonts are embedded using go:embed, ensuring the binaries are fully self-contained.
| Key Binding | Action Description |
|---|---|
β β |
Navigate between the 6 main control panels |
Tab |
Access sub-modes within panels |
β β |
Adjust values in the currently selected panel or navigate text rows in multi-line mode |
Enter |
Activate/deactivate text input mode for editing |
r |
Randomize font, colors, and gradient settings for instant inspiration |
e |
Enter export mode to save your creation in various formats |
Esc |
Quit the application and return to terminal |
The UI features 6 main control panels with sub-modes accessible via Tab key:
- Text Input Mode: Enter and edit text with multi-line support
- Press
βto create new row - Press
ββto navigate between rows - Cursor positions are tracked per-row
- The row count is shown in label when editing multiple rows
- Press
- Text Alignment Mode: Choose Left, Center, or Right alignment
- Browse through 100+ available bitmap fonts
- Shows "Font X/XXX" in label
- Fonts are lazy loaded on first use for memory efficiency
- Character Spacing: 0 to 10 pixels between characters
- Word Spacing: 0 to 20 pixels for multi-word lines
- Line Spacing: 0 to 10 pixels for multi-line text layout
- Text Color 1: Primary text color (14 ANSI colors)
- Text Color 2: Gradient end color
- Gradient auto-enables when different from Text Color 1
- Shows "None" when same as Text Color 1
- Gradient Direction: Up-Down, Down-Up, Left-Right, Right-Left
- Four scale options: 0.5x, 1x, 2x, 4x
- Uses ANSI-aware scaling algorithm
- Handles half-pixel characters correctly
- Horizontal Shadow: -5 to 5 pixels (β or β)
- Shows "Off" at 0 position
- Vertical Shadow: -5 to 5 pixels (β or β)
- Shows "Off" at 0 position
- Shadow Style: Light (β), Medium (β), Dark (β)
- Visual preview shows actual ANSI character repeated
Warning
If shadows are enabled with half-pixel characters, a warning appears in the title bar. The library automatically disables shadows in this case to prevent visual artifacts.
# Render text with default settings
./ansifonts-cli "Hello"
# List all available fonts
./ansifonts-cli -list
# Use specific font and color (ANSI code)
./ansifonts-cli -font ithaca -color 31 "Red"
# Use specific font and color (hex code)
./ansifonts-cli -font ithaca -color "#FF0000" "Red"
# Gradient text with ANSI codes
./ansifonts-cli -font dogica -color 31 -gradient 34 -direction right "Gradient"
# Gradient text with hex codes
./ansifonts-cli -font dogica -color "#FF0000" -gradient "#0000FF" "Gradient"
# Text with shadow
./ansifonts-cli -font larceny -color 94 -shadow -shadow-h 2 -shadow-v 1 "Shadow"
# Scaled text
./ansifonts-cli -font pressstart -color 32 -scale 1 "2X"
# Aligned text
./ansifonts-cli -font gohufontb -color 93 -align right "Go\nRight"| Flag | Description | Values |
|---|---|---|
-font |
Font name to use | Any available font name (default: first font) |
-color |
Text color | ANSI codes (30-37, 90-96) or hex (#FF0000) |
-gradient |
Gradient end color | ANSI codes (30-37, 90-96) or hex (#0000FF) |
-direction |
Gradient direction | down, up, right, left |
-char-spacing |
Character spacing | 0 to 10 |
-word-spacing |
Word spacing | 0 to 20 |
-line-spacing |
Line spacing | 0 to 10 |
-scale |
Text scale factor | -1 (0.5x), 0 (1x), 1 (2x), 2 (4x) |
-shadow |
Enable shadow effect | true/false |
-shadow-h |
Shadow horizontal offset | -5 to 5 |
-shadow-v |
Shadow vertical offset | -5 to 5 |
-shadow-style |
Shadow style | 0 (light), 1 (medium), 2 (dark) |
-align |
Text alignment | left, center, right |
-list |
List all available fonts | - |
Tip
The CLI and library support any hex color (e.g., -color "#FF5733"), providing unlimited color possibilities beyond the ANSI palette.
Bit includes a powerful standalone Go library (ansifonts) that's completely independent of the TUI. The library can be imported into any Go project without any TUI dependencies.
package main
import (
"fmt"
"github.com/superstarryeyes/bit/ansifonts"
)
func main() {
// Load a font
font, err := ansifonts.LoadFont("ithaca")
if err != nil {
panic(err)
}
// Advanced rendering with options
options := ansifonts.RenderOptions{
CharSpacing: 3,
WordSpacing: 3,
LineSpacing: 1,
TextColor: "#FF0000",
GradientColor: "#0000FF",
UseGradient: true,
GradientDirection: ansifonts.LeftRight,
Alignment: ansifonts.CenterAlign,
ScaleFactor: 1.0,
ShadowEnabled: true,
ShadowHorizontalOffset: 2,
ShadowVerticalOffset: 1,
ShadowStyle: ansifonts.MediumShade,
}
// Validate options before rendering (optional - render functions validate automatically)
if err := options.Validate(); err != nil {
fmt.Printf("Invalid options: %v\n", err)
return
}
rendered := ansifonts.RenderTextWithOptions("Hello", font, options)
for _, line := range rendered {
fmt.Println(line)
}
}Tip
See the ansifonts library documentation for detailed API reference and examples.
The project includes 100+ carefully curated bitmap fonts embedded in the binary.
Fonts are stored as .bit files (JSON format) containing:
{
"name": "Font Name",
"author": "Author Name",
"license": "License Type",
"characters": {
"A": ["line1", "line2", ...],
"B": ["line1", "line2", ...],
...
}
}Note
Each font file contains a license field indicating its specific license terms. All fonts are under permissive open-source licenses, which allow free usage, modification, and distribution for both personal and commercial purposes.
The interactive UI supports exporting your creations to:
| Format | Extension | Description |
|---|---|---|
| TXT | .txt |
Plain text with ANSI codes stripped |
| Go | .go |
Go source code with embedded ANSI strings |
| JavaScript | .js |
JavaScript array with console.log display function |
| Python | .py |
Python list with print function |
| Rust | .rs |
Rust vector with println! macro |
| Bash | .sh |
Bash script with echo -e for ANSI support |
All exports include:
- Properly escaped ANSI sequences
- Language-specific string literals
- Ready-to-run code
Contributions are welcome! Please feel free to submit a Pull Request.
Join our Discord community for discussions, support and collaboration for creating new Bit fonts.
This project is licensed under the MIT License. See the LICENSE file for details.
- Font Authors: Thank you to all the original font creators whose work is included.
- Charm: For the excellent TUI framework.
- Go Community: For the robust standard library and tooling.
β Star this repo if you find it useful!