Skip to content

jaydg/ncfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ncfig: NotCurses Tools for FIGlet Fonts

A collection of command-line tools for rendering beautiful FIGlet fonts with Notcurses, featuring true color gradient support.

ncfig Logo

Tools

ncfig

Renders text to the terminal using FIGlet fonts.

Usage:

ncfig -f <font> [-v <gradient>] [-h <gradient>] [-r <gradient>] [text]
Option Description
-f <font> Path to a FIGlet font file (.flf)
-v <gradient> Vertical color gradient
-h <gradient> Horizontal color gradient
-r <gradient> Radial color gradient
text Text to render (default: HELLO NOTCURSES!)

Example:

ncfig -f fonts/banner.flf -v 0xff0000:0x0000ff "Hello"

Vertical and horizontal gradients can be combined (colors are added channel-wise). Radial gradients are mutually exclusive with the others.

ncmarquee

Creates a full-screen marquee animation with FIGlet text. The text floats from right to left, and when it has left the visible area entirely, it comes back in from the right. Press any key to exit.

Usage:

ncmarquee -f <font> [-v <gradient>] [-h <gradient>] [-r <gradient>] [-s <ms>] [-t] [-c] [-w <amplitude>] [text]
Option Description
-f <font> Path to a FIGlet font file (.flf)
-v <gradient> Vertical color gradient
-h <gradient> Horizontal color gradient
-r <gradient> Radial color gradient
-s <ms> Scroll speed in milliseconds (default: 50)
-t Apply gradient and wave to text dimensions (default: apply to the visible area)
-c Circular mode (text is directly followed by itself)
-w <amplitude> Sine wave vertical movement with the given amplitude in rows
text Text to render (default: HELLO NOTCURSES!)

Examples:

# Default speed (50ms)
ncmarquee -f fonts/standard.flf "MARQUEE"

# Faster animation (20ms delay)
ncmarquee -f fonts/standard.flf -s 20 "HELLO WORLD"

# With gradient
ncmarquee -f fonts/banner.flf -h 0xff0000:0x0000ff -s 30 "NOTCURSES"

# Sine wave with 4-row amplitude
ncmarquee -f fonts/banner.flf -w 4 "WAVE"

# Circular sine wave — seamless across repeated instances
ncmarquee -f fonts/banner.flf -c -w 3 "LOOP"

Sine wave mode (-w)

The -w <amplitude> flag adds a vertical sine wave through the scrolling text. Each FIGlet character is displaced independently on the y-axis according to a continuous sine wave, so the text undulates as it scrolls. The amplitude is given in terminal rows.

The -t flag controls the wave's frame of reference:

  • -t off (default): the wave is fixed in screen space — each screen column has a fixed y-offset at any moment in time, and the text scrolls through it. In circular mode (-c) this means adjacent instances share the same wave seamlessly, with no discontinuity at the wrap point.
  • -t on: the wave is fixed to the text — each character carries its own phase based on its position in the string, so the wave pattern travels with the text as it scrolls.

Because terminal rows are discrete, the wave will always be a staircase of integer row steps between characters rather than a truly smooth curve. Larger amplitudes make individual steps proportionally smaller and less noticeable.

Gradients

Gradients are specified as pairs of hexadecimal colors separated by a colon:

  • 0xff0000 = Red
  • 0x00ff00 = Green
  • 0x0000ff = Blue
  • 0xffff00 = Yellow
  • 0xff00ff = Magenta
  • 0x00ffff = Cyan

Example: 0xff0000:0x0000ff creates a red-to-blue gradient. Two colors are mandatory, but you can optionally add a third color as center color, e.g. e.g. 0xff0000:0x00ff00:0x0000ff for a red-to-green-to-blue gradient.

Getting Fonts

I found these sources for FIGlet fonts, two of them on GitHub:

  • The font database on the FIGlet site allows to browse and preview the fonts.
  • Claudio Matsuoka's repository figlet-fonts has everything the FIGlet font database has plus a lot of extra fonts, easily to be cloned to a local repository. Some of the fonts were automatically generated from old X11 fonts and C64 demo fonts, in these cases the quality is not always optimal.
  • The repository github.com/xero/figlet-fonts has a huge collection of fonts in a huge single directory, some to be found on the previous two locations, some new. It is easy to get an overview of the fonts thanks to the examples page.

The FIGlet site has a FTP server as well, but as FTP is so very dead I assume you don't have a client for that.

Building

Requires xmake and a recent C++ compiler.

Build all tools:

xmake

Binaries will be in build/linux/x86_64/release/:

  • ncfig - Static FIGlet renderer
  • ncmarquee - Full-screen marquee animation

Build a specific tool:

xmake build ncfig
xmake build ncmarquee

Debug builds:

xmake f -m debug && xmake

In this case, the executables are in build/linux/x86_64/debug/.

Dependencies

  • Notcurses (notcurses++) — discoverable via pkg-config
  • GCC 16 or Clang 21 - I couldn't get Clang 22 to compile this.

About

Draw FIGlet fonts with true color gradients on the terminal!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages