mbndr / figlet4go

A port of figlet to golang
MIT License
60 stars 9 forks source link

Support for font layout parameters (kerning and "smooshing") #2

Open broofa opened 1 year ago

broofa commented 1 year ago

Per the FIFFont and FIGDriver standard, font authors may provide layout parameters to control kerning and "smushing". It appears these are not honored by this module.

Expected: Over on https://www.askapache.com/online-tools/figlet-ascii/, if we render the string, "Testing" using the "small" font, we get this:

 _____       _   _           
|_   _|__ __| |_(_)_ _  __ _ 
  | |/ -_|_-<  _| | ' \/ _` |
  |_|\___/__/\__|_|_||_\__, |
                       |___/ 

Actual If we render the same string in the same font with this package, we get this:

 _____              _     _
|_   _|  ___   ___ | |_  (_)  _ _    __ _
  | |   / -_) (_-< |  _| | | | ' \  / _` |
  |_|   \___| /__/  \__| |_| |_||_| \__, |
                                    |___/ 
mbndr commented 12 months ago

Hey there, I wanted to implement this a while ago but atm have hardly time to work on my hobby projects because of life happening, feel free to implement it and open a pull request. Kind regards

broofa commented 12 months ago

Alas, I'm in a similar boat.

As a breadcrumb for others who may land here, https://github.com/patorjk/figlet.js appears to have a pretty feature-complete implementation. It might act as a reference point.