_ _ __ _ _ _
___| |(_) / _(_) __ _| | ___| |_
/ __| || |_____| |_| |/ _` | |/ _ \ __|
| (__| || |_____| _| | (_| | | __/ |_
\___|_|/ | |_| |_|\__, |_|\___|\__|
|__/ |___/
A native Clojure re-implementation of FIGlet — the
classic ASCII art text renderer. No shelling out, no external dependencies
beyond Clojure itself. Parses FIGfont files, implements all six horizontal
smushing rules, and produces output identical to the reference C figlet.
FIGlet has been the standard way to render large text in terminals since 1991, but using it from Clojure typically means shelling out to a C binary — which adds a system dependency, a subprocess per call, and makes the output opaque to your program.
clj-figlet is a from-scratch implementation against the FIGfont Version 2 Standard (Cowan & Burton, 1996-97). Fonts load as plain Clojure maps, rendering is a pure function from font + string to string, and the whole thing composes naturally with the rest of the language. No native dependencies, no subprocess, no state.
Add the dependency to your project.clj:
[com.github.danlentz/clj-figlet "0.1.3"]
Then in your code:
(require '[clj-figlet.core :as fig])
(print (fig/render "standard" "Hello!"))
_ _ _ _ _
| | | | ___| | | ___ | |
| |_| |/ _ \ | |/ _ \| |
| _ | __/ | | (_) |_|
|_| |_|\___|_|_|\___/(_)
(print (fig/render "slant" "Clojure"))
________ _
/ ____/ /___ (_)_ __________
/ / / / __ \ / / / / / ___/ _ \
/ /___/ / /_/ / / / /_/ / / / __/
\____/_/\____/_/ /\__,_/_/ \___/
/___/
For repeated rendering, load the font once and pass the font map to
render:
(def font (fig/load-font "fonts/small.flf"))
(print (fig/render font "OK"))
(print (fig/render font "WARN"))
(print (fig/render font "ERR"))
load-font accepts a classpath resource path, a filesystem path, a File, or
a Reader.
A loaded font is a plain Clojure map. You can inspect its properties directly:
(:height font) ;=> 5
(:baseline font) ;=> 4
(:hardblank font) ;=> \$
(:h-layout font) ;=> :smushing
(:h-smush-rules font) ;=> #{1 2 3 4}
(count (:chars font)) ;=> 229
16 fonts ship in resources/fonts/:
| Font | Style |
|---|---|
standard | The classic FIGlet default |
small | Compact version of standard |
big | Tall, bold letters |
doom | Clean, modern variant of big |
slant | Italic / slanted |
smslant | Compact italic |
shadow | Letters with a drop shadow |
smshadow | Compact shadow |
script | Cursive / handwriting |
smscript | Compact cursive |
banner | Large block letters made of # |
block | Heavy block style |
lean | Thin slanted style |
graffiti | Urban graffiti lettering |
starwars | Inspired by the Star Wars title crawl |
mini | Smallest — just 3 lines tall |
See doc/fonts.md for a visual catalog with samples of every font.
Any .flf FIGfont file can be loaded — the library implements the full
FIGfont Version 2 specification.
The bundled fonts are from the FIGlet distribution
and are redistributed under the New BSD License. See
resources/fonts/NOTICE for the full license text.
(defn splash []
(println (fig/render "small" "my-app"))
(println " v1.0.0 — starting up..."))
(splash)
_ __ _ _ ___ __ _ _ __ _ __
| ' \ || |___/ _` | '_ \ '_ \
|_|_|_\_, | \__,_| .__/ .__/
|__/ |_| |_|
v1.0.0 — starting up...
Same text, different personality. The font is just data — easy to let users choose:
(doseq [f ["standard" "doom" "slant" "shadow" "small"]]
(print (fig/render f "Hello")))
_ _ _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
| _ | __/ | | (_) |
|_| |_|\___|_|_|\___/
_ _ _ _
| | | | | | |
| |_| | ___| | | ___
| _ |/ _ \ | |/ _ \
| | | | __/ | | (_) |
\_| |_/\___|_|_|\___/
__ __ ____
/ / / /__ / / /___
/ /_/ / _ \/ / / __ \
/ __ / __/ / / /_/ /
/_/ /_/\___/_/_/\____/
| | | |
| | _ \ | | _ \
___ | __/ | | ( |
_| _|\___|_|_|\___/
_ _ _ _
| || |___| | |___
| __ / -_) | / _ \
|_||_\___|_|_\___/
The implementation follows the FIGfont Version 2
Standard (Cowan & Burton, 1996-97). A copy of the
spec lives in doc/papers/figfont.txt.
Old_Layout and Full_Layout.flc) processinglein test # Run all tests (correctness + showcase)
lein repl # Start a REPL in clj-figlet.core
The test suite compares rendered output against the reference C figlet binary
(install via brew install figlet) across 16 fonts and 24 test strings. A
separate showcase test suite demonstrates practical usage patterns.
This library would not exist without the work of the original FIGlet authors. Glenn Chappell and Ian Chai created FIGlet in 1991 as a 170-line C program called "newban" and grew it into something beloved across the internet. John Cowan and Paul Burton later wrote the FIGfont Version 2 Standard — a remarkably well-designed specification that has aged gracefully for three decades. The format is elegant in its simplicity: plain text all the way down, editable in any text editor, portable across every platform, and expressive enough to support hundreds of fonts with a handful of smushing rules. It is a model of what a small, clear standard can accomplish.
The bundled font files are from the FIGlet distribution (New BSD License) and
carry their own attribution in their header comments. See
resources/fonts/NOTICE for details.
Thank you to Glenn, Ian, John, Paul, Christiaan Keet, and Claudio Matsuoka for creating and maintaining FIGlet over the years, and to the many font designers who contributed to its remarkable library.
Copyright © 2026 Dan Lentz
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |