This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mao Zedong's profile picture

Figlet - a figlet font parser and writer

Started by Mao Zedong, 19 November 2016 - 11:20 AM
Mao Zedong #1
Posted 19 November 2016 - 12:20 PM

A figlet parser and writer API
pastebin get zRxLKh7n figlet


Greetings CC Forums! I have created an API to parse and write UNIX FIGlet files. FIGlet is a font format for making large text, e.g text-based banners. This allows you to use any figlet font in ComputerCraft for your own programs!

Screenshots

Using banner.flf:


Using big.flf:


Get the API
pastebin get zRxLKh7n figlet

Using the API
The API is pretty simple.
  • Load the API with os.loadAPI
  • Create a font instance with figlet.parseFont("filename.flf")
  • Draw the text with figlet.write(font, "text")
For example:

os.loadAPI("figlet")

local font = figlet.parseFont("banner.flf")

print(figlet.write(font, "Hello!"))

Font Files
The API should work with any regular .flf file (though it doesn't support smushing yet). The two I used in this example are banner.flf and big.flf.
LDDestroier #2
Posted 19 November 2016 - 10:58 PM
Cool, I say! Does it support kerning?
Mao Zedong #3
Posted 19 November 2016 - 10:59 PM
Cool, I say! Does it support kerning?

Thanks! Not yet, smushing and kerning are planned features though!