View Source Figlet (figlet v0.3.2)

A FIGlet is a program for making large letters out of ordinary text characters, like this:

                               
                    
                      
                                              
                        
                       
                        
                                         
          
        
                 

(Please note that the formatting inside the docs may not be accurate)

Inspired by patorjk's Text to ASCII Art Generator. Thanks patorjk! See https://github.com/patorjk/figlet-cli and https://github.com/patorjk/figlet.js

Summary

Functions

Prints the given text in all available fonts.

Retrieves info about the font at the given path. This is used internally before rendering text.

Show the fonts currently included with this package. Fonts are identified by their relative paths.

Render the input text into representations using the given font (see opts).

Functions

demo(text)

Prints the given text in all available fonts.

Examples

iex> Figlet.demo("Foo")
...

fonts/figlet.js/Modular.flf
_______  _______  _______
|       ||       ||       |
|    ___||   _   ||   _   |
|   |___ |  | |  ||  | |  |
|    ___||  |_|  ||  |_|  |
|   |    |       ||       |
|___|    |_______||_______|
fonts/figlet.js/Roman.flf
oooooooooooo
`888'     `8
888          .ooooo.   .ooooo.
888oooo8    d88' `88b d88' `88b
888    "    888   888 888   888
888         888   888 888   888
o888o        `Y8bod8P' `Y8bod8P'
...
:ok

font(path)

Retrieves info about the font at the given path. This is used internally before rendering text.

Examples

iex> Figlet.font("figlet.js/Alpha.flf")

list_fonts()

@spec list_fonts() :: {:ok, list()} | {:error, any()}

Show the fonts currently included with this package. Fonts are identified by their relative paths.

Examples

iex> Figlet.list_fonts()
{:ok,
  ["contributed/nipples.flf", ...]

ls_files_r(filepath)

text(input, opts \\ [])

Render the input text into representations using the given font (see opts).

Options

  • font: string path to font file, e.g. ours/banner.flf. Relative paths are interpretted as relative to this package's fonts/ directory.
  • horizontal_layout: default: default
  • vertical_layout: default: default
  • width: integer character screen width, default: 80,
  • whitespace_break: default: true

Examples

iex> Figlet.text("Jump Street", font: "ours/ivrit.flf")
      _                                 ____    _                          _
     | |  _   _   _ __ ___    _ __     / ___|  | |_   _ __    ___    ___  | |_
  _  | | | | | | | '_ ` _   | '_     ___   | __| | '__|  / _   / _  | __|
 | |_| | | |_| | | | | | | | | |_) |    ___) | | |_  | |    |  __/ |  __/ | |_
  ___/   __,_| |_| |_| |_| | .__/    |____/   __| |_|     ___|  ___|  __|
                             |_|