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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: test

on: [push]
on:
- push
- pull_request

jobs:
build:
Expand Down
8 changes: 6 additions & 2 deletions pyfiglet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@ def loadFont(self):
Parse loaded font data for the rendering engine to consume
"""
try:
# Remove any unicode line splitting characters other
# than CRLF - to match figlet line parsing
data = re.sub(r"[\u0085\u2028\u2029]", " ", self.data)

# Parse first line of file, the header
data = self.data.splitlines()
data = data.splitlines()

header = data.pop(0)
if self.reMagicNumber.search(header) is None:
Expand Down Expand Up @@ -808,7 +812,7 @@ def smushChars(self, left='', right=''):

if self.font.smushMode & self.SM_HIERARCHY:
smushes += (
('|', r'|/\[]{}()<>'),
('|', r'/\[]{}()<>'),
(r'\/', '[]{}()<>'),
('[]', '{}()<>'),
('{}', '()<>'),
Expand Down
2 changes: 0 additions & 2 deletions pyfiglet/fonts-contrib/dwhistled.flf
Original file line number Diff line number Diff line change
Expand Up @@ -961,5 +961,3 @@ z@
@
~@
@@


1 change: 1 addition & 0 deletions pyfiglet/fonts-contrib/gradient.flf
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ eeeee....$
@@@@@@:::$
----%%%--$
+++++&&&+$
*****|||*$
====!!!==$
::::::###$
.....@@@@$
Expand Down
Loading