Home

Awesome

pyfiglet

                        _|_|  _|            _|              _|
_|_|_|    _|    _|    _|            _|_|_|  _|    _|_|    _|_|_|_|
_|    _|  _|    _|  _|_|_|_|  _|  _|    _|  _|  _|_|_|_|    _|
_|    _|  _|    _|    _|      _|  _|    _|  _|  _|          _|
_|_|_|      _|_|_|    _|      _|    _|_|_|  _|    _|_|_|      _|_|
_|              _|                      _|
_|          _|_|                    _|_|

Synopsis

pyfiglet is a full port of FIGlet (http://www.figlet.org/) into pure python. It takes ASCII text and renders it in ASCII art fonts (like the title above, which is the 'block' font).

FAQ

Usage

You can use pyfiglet in one of two ways. First, it operates on the commandline as C figlet does and supports most of the same options. Run with --help to see a full list of tweaks. Mostly you will only use -f to change the font. It defaults to standard.flf.

tools/pyfiglet 'text to render'

Pyfiglet is also a library that can be used in python code:

from pyfiglet import Figlet
f = Figlet(font='slant')
print(f.renderText('text to render'))

or

import pyfiglet
f = pyfiglet.figlet_format("text to render", font="slant")
print(f)

If you have found some new fonts that you want to use, you can use the command line interface to install your font file as follows:

pyfiglet -L <font file>

The font file can be a ZIP file of lots of fonts or just a single font. Depending on how you installed pyfiglet, you may find that you need root access to install the font - e.g. sudo pyfiglet -L <font file>.

Author

All of the documentation and the majority of the work done was by Christopher Jones (cjones@insub.org) and many other contributors. Packaged by Peter Waller (p@pwaller.net), various enhancements by Stefano Rivera (stefano@rivera.za.net), and lots of help from many contributors!

Thank you all for your efforts, please send a pull request to add yourself to this list if you would like to take credit.

(In the words of the original author) pyfiglet is a port of FIGlet, and much of the code is directly translated from the C source. I optimized some bits where I could, but because the smushing and kerning code is so incredibly complex, it was safer and easier to port the logic almost exactly. Therefore, I can't really take much credit for authorship, just translation. The original authors of FIGlet are listed on their website at http://www.figlet.org/.

The Python port was done by Christopher Jones cjones@insub.org (http://gruntle.org/).

It is currently maintained by Peter Waller (p@pwaller.net, github:pwaller)

The toilet fonts (.tlf) were imported from toilet 0.3-1, by Sam Hocevar (sam@zoy.org).

Thanks

Lots of people have helped make pyfiglet what it is but I particularly want to call out.

github:stefanor for various bug fixes and improvements and the debian packaging. github:peterbrittain for helping to close lots of issues.

License

The MIT License (MIT) Copyright © 2007-2023

Christopher Jones <cjones@insub.org>
Stefano Rivera <stefano@rivera.za.net>
Peter Waller <p@pwaller.net>
And various contributors (see git history).

(see LICENSE for full details)

Packaging status

Packaging status