patorjk / figlet.js

A FIG Driver written in JavaScript which aims to fully implement the FIGfont spec.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to break lines?

opened this issue · comments

https://github.com/cmatsuoka/figlet has a option :
-t terminal -- FIGlet asks your terminal how wide it is, and uses
this to determine when to break lines. Normally, FIGlet assumes
80 columns so that people with wide terminals won't annoy the
people they e-mail FIGlet output to.

How do I use this?

Currently there isn't a way, this is a good idea though and would be easy to add. I'll try and look into this later this week.

When can we use this feature?

@patorjk do you accept PRs? There are two open, I may take a look and see if I will be able to create line wrapping.

PS: this project is awesome I use in to demo my library jQuery Terminal https://codepen.io/jcubic/pen/VwvEvmN

Yep, I’ve accepted 19 in total. I’d be open to this feature as long as it didn’t negatively effect other things. I looked into it a long time ago but can’t remember why I didn’t add it.

The two PRs outstanding: one looks like spam (I’ve been meaning to take a closer look and close it) and the other changes the formatting of the library (I prefer PRs to be specific and not so multiple things).

Ok, will create PR, I have already working line wrapping, but it don't handle whitespaces yet.

I will use options: width and whitespaceBreak maybe, if width is set it will check the value of whitespaceBreak if it's true it will break the ASCII text on closest whitespae otherwise it will break the words.

Feature added as of version 1.5.0. Release notes here: https://github.com/patorjk/figlet.js/releases/tag/1.5.0