Skip to content
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

Fix for various font issues #118

Merged
merged 4 commits into from
Aug 23, 2023
Merged

Fix for various font issues #118

merged 4 commits into from
Aug 23, 2023

Conversation

peterbrittain
Copy link
Collaborator

This change should:

  • Fix any fonts that use unicode line separators (incluting various tlf files)
  • Address the smushing issue for crawford2
  • Limit tests for tlf files (where we clearly match figet line splitting logic and not toilet)

TBH, I think pyfiglet does the right thing and so we shouldn't force the dodgy line splitting in toilet.

Basically addresses most of the issues in #116.

@@ -336,10 +340,11 @@ def __char(data):
# Load German Umlaute - the follow directly after standard character 127
if data:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe drop this if then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. That was an attempt to fix gradient, which is actually a broken file... Some definitions are missing lines and so pyfiglet runs out of data on the last character. I originally thought it was missing the enter definition, but it dies part-way through in __char().

The real question should probably be whether pyfiglet should soldier on, or reject the font entirely.

Copy link
Collaborator

@stefanor stefanor Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption, when I added that, was that fonts would either have all these german umlaut extensions or not. Just a wild guess, I don't know how the fonts are usually structured.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - that's what figlet does too, but it's clearly happy to stop processing mid character and just use what it found.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the conclusion here. Ready to go or is something outstanding here? I don't have a strong opinion, though possibly it's better to follow figlet's behaviour?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep it simple and just remove the erroneous check.

@pwaller
Copy link
Owner

pwaller commented Aug 22, 2023

(I hope you don't mind, I'm attempting to enable the actions so we can see the tests pass. Not quite sure why they aren't running already. Are you happy for me to merge assuming that they do?)

@pwaller
Copy link
Owner

pwaller commented Aug 22, 2023

There we go. Tests are running now.

@pwaller pwaller merged commit 6331a96 into pwaller:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants