FIGlet Fonts Explained: How Text-to-ASCII Rendering Works
Every ASCII text banner you see in a terminal or README starts life as a font definition. FIGlet, the tool that pioneered automated ASCII text rendering, uses a specific file format and a set of layout algorithms to transform plain strings into block-letter art. Understanding how FIGlet fonts work helps you pick the right style for any project.
A Brief History of FIGlet
Leslie Ayers, Ian Chai, and Christiaan Keet created FIGlet in 1991. The name is a play on "Frank, Ian, and Glenn's letters" — the original contributors. FIGlet solved a simple problem: no one wanted to hand-draw large text banners for every script, welcome message, or BBS login screen.
FIGlet's design philosophy was straightforward. Define each character as a grid of ASCII glyphs, store those definitions in a font file, and render arbitrary strings by stitching characters together. That core approach has not changed in over three decades.
The FLF Font File Format
FIGlet fonts use the FLF (FIGlet Letter Font) format. An FLF file is a plain-text file with two sections: a header and the character definitions.
The Header
The first line of an FLF file contains six fields separated by whitespace:
flf2a$ 6 5 16 15 11 0
| Field | Meaning |
|---|---|
flf2a$ | Magic string and hardblank character (here $) |
6 | Height of each character in lines |
5 | Baseline position (lines from top to baseline) |
| Not used directly in rendering | |
16 | Max character width |
15 | Number of comment lines after the header |
11 | Print direction — 0 for left-to-right |
0 | Full layout code (controls smushing rules) |
The hardblank character is critical. It represents a space that should never be removed during smushing (character merging). Typically set to $ or @, it prevents the gaps between character strokes from collapsing.
Character Definitions
After the header and comment lines, each character is defined as successive lines of text, terminated by a line containing ONLY the end marker (usually a newline-like character pair). Characters are listed in order starting from code point 32 (space).
A simple three-line font might define the letter "A" like this:
#
# #
#####
# #
# #
Each line is exactly the same width for that character. FIGlet reads these definitions character by character and assembles them into a complete output.
How Rendering Works: Layout Modes
FIGlet does not simply place characters side by side. It applies layout rules to merge adjacent characters, reducing gaps and creating a more cohesive visual appearance. There are three primary layout modes.
Full Width
Characters are placed with their full defined width, including trailing spaces. No merging occurs. This produces the widest output with visible gaps between letters.
Horizontal Fitting (Kerning)
Characters are shifted left until at least one pair of adjacent columns contains a non-space character in both the left and right characters. This tightens the output like kerning in typography.
Smushing
Smushing is the most aggressive layout mode. After kerning, FIGlet continues shifting characters left and attempts to merge overlapping characters into a single character. Smushing only works when specific rules allow the merge.
The Six Smushing Rules
Smushing is governed by six rules, each controlling when two overlapping characters can merge into one. These rules are encoded in the font header's layout code.
| Rule | Name | Merge Condition |
|---|---|---|
| 1 | Equal Character | Both characters are the same (e.g., two / merge into one /) |
| 2 | Underscore | One character is _ and the other is one of |/, |
| 3 | Hierarchy | One character belongs to a higher class: | > /\ > [] > {} > () |
| 4 | Opposite Pairs | Characters form a pair: /\, \/, (), )(, [], ][, {}, }{ |
| 5 | Big X | Characters combine into > or < (e.g., / and \ become >) |
| 6 | Hardblank | Two hardblanks merge into a single hardblank |
When none of the enabled rules apply, the characters cannot merge and FIGlet stops shifting. The super-smushing mode (rule 6 combined with others) produces the tightest possible output.
Ten Popular FIGlet Fonts Compared
FIGlet ships with a standard set of fonts, and the community has contributed hundreds more. Here are ten widely used fonts with their characteristics:
| Font | Height | Style | Best For |
|---|---|---|---|
| Standard | 6 | Classic block letters | General use, README headers |
| Slant | 6 | Italic/leaning style | Emphasized text, logos |
| Banner | 7 | Wide, heavy block letters | Terminal welcome banners |
| Block | 6 | Double-stroke outlined | Visual hierarchy, section headers |
| Digital | 6 | LCD/7-segment display | Tech-themed projects |
| Small | 4 | Compact lowercase-like | Space-constrained areas |
| Shadow | 6 | Characters with drop shadow | Decorative headers |
| Speed | 4 | Thin, diagonal strokes | Narrow terminals |
| Star Wars | 8 | Wide cinematic style | Fun, entertainment projects |
| Graffiti | 8 | Bold, rounded strokes | Creative, informal contexts |
Choosing the Right Font for Your Project
Consider these factors when selecting a FIGlet font:
Terminal width constraints. If your banner must fit in an 80-column terminal, measure the rendered width before committing. Fonts like Banner and Star Wars produce very wide output — a 10-character string can easily exceed 100 columns.
Readability at a glance. Some fonts prioritize style over legibility. If the text needs to be instantly readable, Standard or Slant are safer choices than Speed or Digital.
Visual tone. A corporate CLI tool calls for a different font than a personal dotfiles repo. Standard and Block feel professional. Shadow and Graffiti feel playful.
Output destination. Code comments and log files benefit from compact fonts like Small. README files and terminal splash screens have room for taller fonts like Banner.
Practical Usage Tips
# List all available fonts
figlet -I2
# Render text in a specific font
figlet -f slant "Deploy"
# Center output within 80 columns
figlet -c -w 80 "Hello"
# Clamp maximum width
figlet -w 60 "Long Project Name"
You can also use FIGlet programmatically in shell scripts to generate dynamic banners for deployment logs, CI pipelines, or server startup messages.
Key Takeaways
- FLF files define each ASCII character as a grid and include metadata for layout rules
- FIGlet supports three layout modes: full width, horizontal fitting, and smushing
- Six smushing rules control how overlapping characters merge, producing tighter output
- Font selection depends on terminal width, readability needs, and visual tone
- Always test rendered output in the target environment — width and rendering vary
Related Guides
- ASCII Art Guide: Creating Text-Based Visual Designs
- The History of Text Art: From Typewriters to Digital ASCII
Try It Yourself
Explore FIGlet fonts interactively with our free online ASCII Art generator. Switch between fonts, adjust width, and preview your banner before copying it to your project.