A lightning-fast, terminal-based font previewer with Sixel graphics support, designed for designers and developers who work with fonts in Linux/Unix environments.
This script is part of the shell_utils framework, one of the largest collections of scripts and utilities aimed at simplifying and enhancing user experience in the terminal.
- 🖼️ Interactive previews with real-time rendering
- 🎨 Fully customizable colors, sizes, and sample text
- 📋 Automatic clipboard integration (supports X11, Wayland, Termux)
- 🔍 Fuzzy search through all available system fonts
- 🖌️ Image export capability for documentation
- 📱 Termux/Android compatible
- 🎚️ Environment variable configuration
- 🌈 Sixel graphics support for modern terminals
# Debian/Ubuntu
sudo apt install imagemagick fzf
# Arch Linux
sudo pacman -S imagemagick fzf
# Fedora
sudo dnf install ImageMagick fzf
# macOS (via Homebrew)
brew install imagemagick fzf
wget https://raw.githubusercontent.com/felipefacundes/fontpreview/main/fontpreview -O ~/.local/bin/fontpreview
chmod +x ~/.local/bin/fontpreview
fontpreview
fontpreview --margin-height 90 --size "1200x800" --font-size 36 --bg-color "#290a04" --fg-color "#f5e0c9"
fontpreview -i "FiraCode.otf" -o "fira_preview.png"
fontpreview --help
Customize defaults through environment variables (add to your .bashrc
/.zshrc
):
export FONT_SIZE=36
export SIZE="1200x800"
export BG_COLOR="#290a04"
export FG_COLOR="#f5e0c9"
export PREVIEW_TEXT="Custom Preview Text\n1234567890\nABCDEFGHIJKLMNOPQRSTUVWXYZ"
export FZF_MARGIN_R=70 # Right margin percentage
export FZF_MARGIN_H=90 # Height percentage
While in interactive mode:
↑
/↓
- Navigate font listEnter
- Select font (copies to clipboard)Esc
/Ctrl+C
- Exit
For best experience, use a Sixel-compatible terminal:
Problem: Preview not displaying
Solution: Ensure your terminal supports Sixel graphics or install feh
as fallback:
sudo pacman -S feh # ArchLinux
sudo apt install feh # Debian/Ubuntu
Problem: Missing fonts
Solution: Specify exact path with -i
flag
Install: To install additional fonts, use the --install
flag and provide the font file exact path with -i
Pull requests are welcome! For major changes, please open an issue first to discuss proposed changes.
This project is licensed under the GPLv3 License - see the LICENSE file for details.
Crafted with ❤️ by [Felipe Facundes]