common-nighthawk / go-figure

Prints ASCII art from text.
MIT License
608 stars 51 forks source link

Additional spaces between letters #10

Open kosatnkn opened 4 years ago

kosatnkn commented 4 years ago

The generated ASCII art has additional spaces in between letters. This happens with many font types.

What I get

                                         __
   _____  ____ _   ____ ___     ____    / /  ___
  / ___/ / __ '/  / __ '__ \   / __ \  / /  / _ \
 (__  ) / /_/ /  / / / / / /  / /_/ / / /  /  __/
/____/  \__,_/  /_/ /_/ /_/  / .___/ /_/   \___/
                            /_/

What I want

                                   __
   _____ ____ _ ____ ___   ____   / /___
  / ___// __ '// __ '__ \ / __ \ / // _ \
 (__  )/ /_/ // / / / / // /_/ // //  __/
/____/ \__,_//_/ /_/ /_// .___//_/ \___/
                       /_/
common-nighthawk commented 4 years ago

Can you provide a few example fonts? Thanks!

kosatnkn commented 4 years ago

Font: big

 __  __             
|  \/  |            
| \  / | ___   ___  
| |\/| |/ _ \ / _ \ 
| |  | | (_) | (_) |
|_|  |_|\___/ \___/ 

 __  __
 |  \/  |
 | \  / |   ___     ___
 | |\/| |  / _ \   / _ \
 | |  | | | (_) | | (_) |
 |_|  |_|  \___/   \___/

Font: block

_|      _|                      
_|_|  _|_|    _|_|      _|_|    
_|  _|  _|  _|    _|  _|    _|  
_|      _|  _|    _|  _|    _|  
_|      _|    _|_|      _|_|    

_|      _|
_|_|  _|_|     _|_|       _|_|
_|  _|  _|   _|    _|   _|    _|
_|      _|   _|    _|   _|    _|
_|      _|     _|_|       _|_|

Font: shadow

  \  |             
 |\/ |  _ \   _ \  
 |   | (   | (   | 
_|  _|\___/ \___/ 

   \  |
  |\/ |    _ \     _ \
  |   |   (   |   (   |
 _|  _|  \___/   \___/

There's a few more that I came across.

Hope this'll help

ondrej-fabry commented 3 years ago

This is the only reason that prevents me from using this library, forcing me to use online ASCII text generators like http://www.network-science.de/ascii/

metalworn commented 1 year ago

Same issue. Use this online as comparsion: http://patorjk.com/software/taag/#p=display&f=Standard&t=GitHub

Or cli figlet:

> figlet GitHub
  ____ _ _   _   _       _
 / ___(_) |_| | | |_   _| |__
| |  _| | __| |_| | | | | '_ \
| |_| | | |_|  _  | |_| | |_) |
 \____|_|\__|_| |_|\__,_|_.__/

This lib:

     ____   _   _     _   _           _
    / ___| (_) | |_  | | | |  _   _  | |__
   | |  _  | | | __| | |_| | | | | | | '_ \
   | |_| | | | | |_  |  _  | | |_| | | |_) |
    \____| |_|  \__| |_| |_|  \__,_| |_.__/
mwmahlberg commented 2 weeks ago

If I am not mistaken, this line

https://github.com/common-nighthawk/go-figure/blob/734e95fb86be9194fff173d46130cf717d719dd1/figure.go#L60C60-L60C81

and more specifically, the figure.font.hardblank parameter is the cause.