New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slant front weird rendering #61
Comments
It's not about wrapping it's about merging lines same can be observed at demo when type two lines http://patorjk.com/software/taag/#p=display&f=Slant&t=Terminal%0AChess . |
Thank you for the report. This looks like a bug in the vertical smushing. Unfortunately I’m on mobile right now and won’t be able to take a closer look until tonight. |
So it looks like this isn't a bug, but rather a consequence of the font author not setting good layout parameters for the font. The Slant font has a full_layout value of 18319 [1]. This means it's layout options are: [2]
It's "Apply vertical smushing rule 2 when smushing" that is causing this effect. My guess, from the comment at the top of the font file, is that Paul Burton just copied the layout parameter from another font. Changing the full_layout parameter to 17807 (which will exclude that rule), should fix this issue. [1] https://github.com/patorjk/figlet.js/blob/master/fonts/Slant.flf |
Great, investigation. Will you publish to npm version 1.5.1 with the fix? |
Can you create the branch with the fix where I can test? I wanted to test master branch from https://cdn.jsdelivr.net/gh/patorjk/figlet.js@master/fonts/ but it seems that there was no commit. |
Or maybe you will not update the Font because it's someone else document? |
I've checked linux figlet and it seems that it don't work like this, maybe there is layout mode that allow this but it's not documented (I was not able to find it):
If you know how to enable same behavior in original figlet it can be reported as a bug. |
I will take a closer look at this - at first I thought it was because the linux figlet didn't support full_layout, but it may be an issue with vertical underscore smushing. I've updated the font in master, and it looks like it works - but I may revert that change if I find the bug is actually in the underscore smushing (I have to run some errands but I should be able to tackle this this afternoon). |
So there was a bug, I've updated master. Can you confirm that it works correctly? Here's what the output should be based on the layout rules:
This is different than the linux version because the linux version doesn't support the full_layout parameter and instead uses the old_layout parameter. Full_layout was added when the figlet creators released FigWin, though that version has long since died and for whatever reason they never updated their linux app (the figlet spec mentions this - that FigWin implements the full spec and the figlet linux app does not. I think maybe they thought FigWin would replace the command line app). Also, if you want to avoid vertical smushing, you can manually set the vertical layout with verticalLayout (just set it to "fitted" or "full"). Most fonts default to using one of those two values. |
There is one inconsistency maybe another bug you can see in latest code from master https://codepen.io/jcubic/pen/JjGxvMY
I think that the issue is with
|
This looks to be expected. For "Terminal Chess" with 5 underscores, it doesn't merge the lines because the full_layout parameter specifies that it's to use rules 1-3 for vertical smushing:
A "," plus an "_" doesn't meet any rules for smushing, so the line can't be smushed. |
What about this:
I've edited previous comment multiple times, one the example show same code but with _ before chess with o it's the same. |
That case is the same as the previous one. "," can take the place of " " with no problem, but "," and "_" can't be smushed together. That's why the first case smushes together a line closer than the second case. |
I've just got weird rendering of text "Terminal Chess" in Slant font when wrapping.
See the "e" letter. Reproducing demo https://codepen.io/jcubic/pen/JjGxvMY?editors=0010
The text was updated successfully, but these errors were encountered: