Skip to content

Figlet: Examples

Damian edited this page Dec 18, 2022 · 1 revision

Or how to actually use this

The examples here are pretty basic. For a more extensive idea of what you could do with it, check out https://github.com/demonnic/figinator

These all assume you've installed the MDK package, required figlet, and loaded the included font like so:

local fig = require("MDK.figlet")
fig.readfont(getMudletHomeDir() .. "/MDK/Big.flf")

Basic text

echo(fig.getString("Test"))
 _______                _    
|__   __|              | |   
   | |      ___   ___  | |_  
   | |     / _ \ / __| | __| 
   | |    |  __/ \__ \ | |_  
   |_|     \___| |___/  \__| 

With kerning

-- echo(fig.getString("Test", true))
echo(fig.getKern("Test"))
 _______             _   
|__   __|           | |  
   | |     ___  ___ | |_ 
   | |    / _ \/ __|| __|
   | |   |  __/\__ \| |_ 
   |_|    \___||___/ \__|
                         

With smushing

-- echo(fig.getString("Test", nil, true))
echo(fig.getSmush("Test"))
 _______          _   
|__   __|        | |  
   | |    ___ ___| |_ 
   | |   / _ / __| __|
   | |  |  __\__ | |_ 
   |_|   \___|___/\__|