Skip to content

Repository files navigation

Maven Central Version Maven Central Last Update GitHub Stars
GitHub Actions Build Status CodeQL Workflow Status Javadoc

figlet

ASCII art banners for your Maven build

figlet is a pure-Java library and Maven plugin for rendering text as ASCII art, powered by classic FIGfont (.flf) and TOIlet (.tlf) fonts — no native figlet binary, no external tools, works anywhere a JVM runs.

  ░█▀▀░▀█▀░█▀▀░█░░░█▀▀░▀█▀
  ░█▀▀░░█░░█░█░█░░░█▀▀░░█░
  ░▀░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░░▀░

Key Features

  • Pure Java, no third-party runtime dependenciesfiglet4j only pulls in its own bundled font resources; runs anywhere a JVM does.

  • A huge font collection, built in — 146 FIGfonts bundled by default, plus 400+ more via the optional figlet-fonts-xero module.

  • Maven-nativefiglet-maven-plugin prints a banner straight into your build log; it runs once per multi-module reactor, not once per module.

  • Markup DSL — mix several fonts and literal, unrendered text in a single banner, with Maven ${...} property placeholder support.

  • Word-wrap & kerning — automatic word-wrapping at a configurable width, with glyphs fitted together instead of separated by ragged whitespace.

  • High test coverage — JUnit 5 + AssertJ across the parser, renderer, font loader and every Mojo.

Modules

Module Description
figlet4j Pure Java library for rendering text using FIGfonts (.flf) and TOIlet fonts (.tlf)
figlet-fonts-figletorg 146 standard FIGfont resources collected from figlet.org
figlet-fonts-xero 400+ additional FIGfonts and TOIlet fonts from the xero/figlet-fonts repository
figlet-maven-plugin Maven plugin — print ASCII art banners during your build

Tech Stack & Requirements

  • To use figlet-maven-plugin: Maven 3.6.0+ and any JVM — the published artifacts target Java 11 bytecode.
  • To use figlet4j as a standalone library: Java 11 or higher.
  • To build this project from source: JDK 17+ and Maven 3.9.0+ (enforced by the build itself; the compiled artifacts still target Java 11).

Installation

As a Maven plugin

Add to your pom.xml:

<plugin>
  <groupId>io.github.spannm</groupId>
  <artifactId>figlet-maven-plugin</artifactId>
  <version>1.0.0</version>
  <configuration>
    <content>${project.name} ${project.version}</content>
    <font>chunky</font>
  </configuration>
</plugin>

As a Java library (figlet4j)

Maven (pom.xml)

<dependency>
  <groupId>io.github.spannm</groupId>
  <artifactId>figlet4j</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle (Groovy / build.gradle)

implementation 'io.github.spannm:figlet4j:1.0.0'

Gradle (Kotlin DSL / build.gradle.kts)

implementation("io.github.spannm:figlet4j:1.0.0")

Quick Start

FigletFont font = FigletFontLoader.loadBuiltin("standard");
FigletRenderer renderer = new FigletRenderer(font).withWidth(100);
System.out.println(renderer.render("Hello World"));

Or mix multiple fonts and plain text during a Maven build with the markup DSL below.

Goals

Goal Default phase Description
figlet:render validate Renders ASCII art to the build log
figlet:list-fonts (none) Lists all available fonts with metadata
figlet:help (none) Shows usage and credits

Note: In a multi-module reactor build, figlet:render only executes for the execution-root project (the module Maven was invoked on) and silently does nothing for every other module — even if the plugin is bound in a child module's own pom.xml. This avoids printing the same banner once per module.

render configuration

Parameter Property Default Description
content figlet.content ${project.name} Content to render; supports ${...} property placeholders and the markup DSL to mix multiple fonts with plain text
font figlet.font standard Name of a built-in font (see figlet:list-fonts)
fontFile figlet.fontFile (none) Path to an external .flf or .tlf file; takes precedence over font when both are set
width figlet.width 72 Max output width; long lines wrap at word boundaries
strict figlet.strict true Fail if the content contains characters not supported by the font, or a ${...} placeholder cannot be resolved
target figlet.target info Where to write the banner: info, debug, stdout, or stderr
skip figlet.skip false Skip this goal entirely

list-fonts configuration

Parameter Property Default Description
metadata figlet.metadata false Load every font and print its metadata comment block (author, date, …)
sample figlet.sample false Render a short ASCII-art sample for every listed font
sampleText figlet.sampleText (random) Custom sample text; defaults to a varied, always-renderable fallback
skip figlet.skip false Skip this goal entirely

Markup DSL

content may mix ASCII-art banners in different fonts with literal, unrendered text:

<content><![CDATA[
  <figletFont name="standard">${project.name}</figletFont><lineBreak/>
  <figletFont name="small">${project.version}</figletFont><lineBreak/>
  built by ${user.name}
]]></content>
  • <figletFont name="...">...</figletFont> — enclosed text is rendered as ASCII art using the named built-in font.
  • <lineBreak/> — an explicit line break, independent of font or automatic word-wrapping.
  • <preserveWhitespace>...</preserveWhitespace> — enclosed text is emitted verbatim (leading/trailing whitespace and blank lines kept), unlike plain text which is trimmed.
  • Everything else is literal text, printed as-is.
  • If content contains no <figletFont> tag at all, the whole (resolved) content is rendered as a single banner using font/fontFile — exactly as if it had been wrapped in one <figletFont> tag referencing that font.

Fonts

Run mvn figlet:list-fonts to browse every font on your classpath — add -Dfiglet.sample=true to render a live sample of each one.

Font files retain their original licenses — see the LICENSE.txt in each figlet-fonts-* module for details.

Building from source

git clone --recurse-submodules https://github.com/spannm/figlet.git
cd figlet
mvn

Note: The project uses a Git submodule (figlet-fonts-xero) for its extended font collection. Make sure to clone with --recurse-submodules, or run git submodule update --init --recursive after cloning.

Contributions welcome!

Got a bug to fix or a feature to add?

  1. Check out the Issues
  2. Fork the repo
  3. Submit a Pull Request

Note: Please ensure your code follows the project's quality standards (Checkstyle and Error Prone are enforced during the build).

───────────────

License

figlet is licensed under the Apache License, Version 2.0.

Font files retain their original licenses. See the respective LICENSE.txt or notice files within the font resource modules for detailed third-party licensing information.

Credits

  • FIGlet — Glenn Chappell, Ian Chai, Frank Sheeran (1991) — https://www.figlet.org
  • TOIlet — Sam Hocevar (2006) — localhost/libcaca TOIlet tools (Sub-set specification support)
  • FIGfont spec — John Cowan, Paul Burton (1996/1997)
  • jfiglet — Lajos Puskas, inspired by Benoît Rigaut's CERN implementation

 

Enjoying figlet? Please leave a 🌟 to support the project!
Your stars help others discover the project and keep it maintained.

About

figlet4j library and figlet-maven-plugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages