Posted on
Software

figlet: ASCII art text generator

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Figlet: Transforming Text into Art with ASCII on Linux Bash

In the realm of Linux, versatility and fun often go hand in hand. One such remarkable utility that underscores this blend is figlet. This simple yet powerful tool enables users to create large, impressive ASCII art text out of ordinary string input. It can be of great use in spicing up your scripts, decorating your terminal, or even making headers for printouts. In this blog post, we will explore what figlet is, how you can install it, and how to use it to generate stunning text-based art.

What is Figlet?

Figlet stands for "Frank, Ian and Glenn's Letters", named after its creators. It is a program that generates text banners in a variety of typefaces composed of conglomerations of letters or other characters. It’s extremely useful for creating standout message banners in scripts or console sessions.

Installing Figlet on Linux

Installation of figlet varies with the distribution of Linux you are using. Here's how you can install it on Debian/Ubuntu, Fedora, and openSUSE systems.

Debian/Ubuntu

For those who are using Debian-based distributions like Ubuntu, figlet can be installed using the apt package manager. Open your terminal and enter the following commands:

sudo apt update
sudo apt install figlet

This will download and install figlet, and you should be able to start using it right away.

Fedora

If you are using Fedora or any related distributions, you use dnf—Fedora's package manager. To install figlet, run:

sudo dnf install figlet

Fedora’s repositories directly provide the package, making installation straightforward.

openSUSE

For openSUSE users, zypper is the package manager of choice. You can install figlet by entering the following command in the terminal:

sudo zypper install figlet

Just like with the other package managers, this command will fetch and install figlet along with its dependencies.

How to Use Figlet

Using figlet is simplicity itself. To convert text to ASCII art, simply type figlet followed by the text you wish to convert:

figlet Hello, World!

This command will display "Hello, World!" in ASCII art format using the default font.

Customizing Output

Figlet comes with several options that allow users to customise the output. Some of the notable options include:

  • -f <font>: To specify a particular font.

  • -c: To center the text.

  • -l: To align the text to the left.

  • -r: To align the text to the right.

Changing Fonts

Figlet can utilize different types of fonts. They are stored in .flf files, usually located in /usr/share/figlet/. To use a different font, simply specify it with the -f option:

figlet -f slant Hello, World!

This command will render “Hello, World!” using the 'Slant' font.

Conclusion

Figlet is a delightful tool for anyone looking to add a touch of creativity and flair to their text presentations. Whether you're automating server scripts or just want to liven up your terminal, figlet provides a quick, easy way to transform plain text into something extraordinary. With its straightforward installation and diverse font options, it continues to be a favorite in the toolkit of many Linux enthusiasts.

Experiment with different fonts and options. The true limit with figlet is but your own creativity. Happy text crafting!