patorjk / figlet.js

A FIG Driver written in JavaScript which aims to fully implement the FIGfont spec.
MIT License
2.61k stars 167 forks source link

Reversed text bug for ivrit font #45

Closed faressoft closed 5 years ago

faressoft commented 5 years ago

The ivrit font has a weird behaviour. The text is printed as reversed text.

console.log(figlet.textSync('Logged In', {
  font: 'ivrit'
}));
        ___       _                        _
  _ __ |_ _|   __| | ___  __ _  __ _  ___ | |
 | '_ \ | |   / _` |/ _ \/ _` |/ _` |/ _ \| |
 | | | || |  | (_| |  __/ (_| | (_| | (_) | |___
 |_| |_|___|  \__,_|\___|\__, |\__, |\___/|_____|
                         |___/ |___/
patorjk commented 5 years ago

That's part of the font's design. If you look at the font's header [1], you'll see this line:

flf2a$ 6 5 76 15 14 1 16271

The 7th parameter is a 1, which indicates the print direction [2]. So that font was designed to print it's input backwards.

[1] https://github.com/patorjk/figlet.js/blob/master/fonts/Ivrit.flf [2] https://github.com/patorjk/figlet.js/blob/master/doc/figfont.txt#L595