I'm not a blogger, but I play one on teh intarwebs.

The 'Leet Text Filter Toys Of Linux

Date/Time Permalink: 06/10/12 03:08:32 pm
Category: ANSI art

Whenever I get the urge to blog about ASCII/ANSI/Unicode art, I start to think "Nahhh, that stuff's old hat and going out of style," only to be proven wrong again and again. ASCII art culture keeps coming back. Now we have smartphone texting and Twitter, with ASCII art popping up there. I keep seeing ASCII sigs on Facebook and Google+ (and MySpace danged near went crazy with it in its day). The most popular social linking site is now Reddit, which is the closest thing to a pure text mainstream website we have today, and they rediscover ASCII art every week. Go to Craigslist (another text-heavy site) and there's ASCII art stuff all over the place there. 4chan remains obsessed with ASCII art. Anybody around me keeps asking how to insert some Unicode doodad.

Oh, OK, I give up. Text toys are here to stay! Here's a fun little gallery of text art, filters, and text toys on Linux:

Figlet Figlet home page

Most of you've seen this before. It takes whatever text you type and renders it in an ASCII font. I found no package for Fedora, but got the tarball from the home site and nudged it in with a 'make' and 'make install', not being picky.

.
 ____                        _         ____      _       
|  _ \ ___ _ __   __ _ _   _(_)_ __   |  _ \ ___| |_ ___ 
| |_) / _ \ '_ \ / _` | | | | | '_ \  | |_) / _ \ __/ _ \
|  __/  __/ | | | (_| | |_| | | | | | |  __/  __/ ||  __/
|_|   \___|_| |_|\__, |\__,_|_|_| |_| |_|   \___|\__\___|
                 |___/                                   

The default.

Different font files are available with the "-f" option...

.
 , _                                , _          
/|/ \ _        _,       o          /|/ \ __|_  _ 
 |__/|/ /|/|  / | |  |  | /|/|      |__/|/ |  |/ 
 |   |_/ | |_/\/|/ \/|_/|/ | |_/    |   |_/|_/|_/
               (|                                

One thing you'll notice right away is that you don't seem to have all the fonts listed on the site. You can FTP whole packs of them here. Then drop the ".flf" files in /usr/local/share/figlet (assuming you've done everything the same way I have).

Now I have the good stuff:

.
d8888b. d88888b d888888b d88888b 
88  `8D 88'     `~~88~~' 88'     
88oodD' 88ooooo    88    88ooooo 
88~~~   88~~~~~    88    88~~~~~ 
88      88.        88    88.     
88      Y88888P    YP    Y88888P 

Cowsay Cowsay home page

Cowsay gets posted about all the time, just like Figlet. It's part of the standard text toys often installed on systems with things like BSD-games on them. Honestly, I forget how I got it on my fedora laptop. Maybe a wizard did it. Anyway: not many users twig to the concept that you can combine Figlet and Cowsay, but only if you use the "-n" option on cowsay so it doesn't wordwrap:

.
%> figlet -f doom "Moo" | cowsay -n
 ______________________ 
/ ___  ___             \
| |  \/  |             |
| | .  . | ___   ___   |
| | |\/| |/ _ \ / _ \  |
| | |  | | (_) | (_) | |
| \_|  |_/\___/ \___/  |
|                      |
\                      /
 ---------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Now, that's a more eloquent cow!

Boxes Boxes home page

Boxes is very much like cowsay; feed it text, get text in a picture back. It was born on my machine's Fedora install, possibly with the programming tools package. It's mainly for creating easy formatted code comments for programmers (in just about any language), but over the years contributors have added ASCII art doodads and now it's just another sassy text toy. Once again, you can pipe figlet and cowsay into boxes as well:

.
%> figlet -f doom "Moo" | cowsay -n | boxes -d peek -p a1b2

/*       _\|/_
         (o o)
 +----oOO-{_}-OOo---------------+
 |                              |
 |  ______________________      |
 | / ___  ___             \     |
 | | |  \/  |             |     |
 | | | .  . | ___   ___   |     |
 | | | |\/| |/ _ \ / _ \  |     |
 | | | |  | | (_) | (_) | |     |
 | | \_|  |_/\___/ \___/  |     |
 | |                      |     |
 | \                      /     |
 |  ----------------------      |
 |         \   ^__^             |
 |          \  (oo)\_______     |
 |             (__)\       )\/\ |
 |                 ||----w |    |
 |                 ||     ||    |
 |                              |
 |                              |
 +-----------------------------*/

That's right, we're just going to keep getting more and more meta. Leave out the cow, and we have a decent little ASCII banner for things like GameFAQ walkthroughs:

.
%> echo "Minecraft" | figlet -f gothic | boxes -d whirly
 .+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.
(                                                         )
 )  /\\,/\\,                                   /\   ,    (
(  /| || ||   '                          _    ||   ||     )
 ) || || ||  \\ \\/\\  _-_   _-_ ,._-_  < \, =||= =||=   (
(  ||=|= ||  || || || || \\ ||    ||    /-||  ||   ||     )
 )~|| || ||  || || || ||/   ||    ||   (( ||  ||   ||    (
(  |, \\,\\, \\ \\ \\ \\,/  \\,/  \\,   \/\\  \\,  \\,    )
 )_-                                                     (
(                                                         )
 "+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"

Yes, this banner could be commercial, with a few margaritas and the right company. But wait, there's more!

Text filters Filters home page

While this doesn't make ASCII art, it does have a variety of filters for text which output text in various funny accents. These are about impossible to find a Fedora package for, but I have an old copy I never even bothered to install (because I don't want my /bin/ file cluttered up for arcane programs that I'm only going to use once a blue moon). Instead, they're just in a directory that isn't normally added to my executable $PATH, and I call one by piping text into it.

"Linux rocks" turns to "l1nux r0ck5" with the "eleet" filter and so on.

This means that we can automatically spice up text before we pipe it to an ASCII font and give it to one of the animals in cowsay (check /usr/share/cowsay):

.
%> echo "Linux rocks" | ./code/text_filters/eleet | figlet -f slant | cowsay -n -f tux
 __________________________________________________________ 
/     _____                         ____       __   ______ \
|    / <  /___  __  ___  __   _____/ __ \_____/ /__/ ____/ |
|   / // / __ \/ / / / |/_/  / ___/ / / / ___/ //_/___ \   |
|  / // / / / / /_/ />  <   / /  / /_/ / /__/ ,< ____/ /   |
| /_//_/_/ /_/\__,_/_/|_|  /_/   \____/\___/_/|_/_____/    |
\                                                          /
 ---------------------------------------------------------- 
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/

Emacs Artist Mode Artist Mode page at Emacs Wiki

So what if you want to draw ASCII art of your own? You can do that in Emacs, M-x artist-mode and if you're running XEmacs on a desktop, you can middle-click with the mouse to get a menu of operations and then draw with left-click just like a paint program, and exit with C-c C-c.

There's also AAlib and LibCaca for converting image files to text graphics, but that's kind of getting far away from the point here and those programs get blogged all the time anyway.

Anyway, my main point here was to point out the modular nature of these programs, how they can work together and combine to create new works that nobody ever thought of. There's new art forms buried in here yet waiting to be discovered.

Welcome back to the art of text, kiddies! Now go practice your tri-force.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon