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

Allow loading fonts automatically from /usr/share/figlet #86

Open
mixmastamyk opened this issue Jan 4, 2021 · 11 comments
Open

Allow loading fonts automatically from /usr/share/figlet #86

mixmastamyk opened this issue Jan 4, 2021 · 11 comments

Comments

@mixmastamyk
Copy link

Hi, so there are a number of great fonts installed with the figlet package under Debian/Ubuntu, but don't seem to be included with pyfiglet.

I'm not sure if that is by design or not, but in the meantime it would be nice if pyfliglet could read the fonts out of /usr/share/figlet automatically without having to use the load -L path option beforehand.

That would allow me to use better fonts than standard and small (which seem to be the only legible ones included in pyfiglet) for my app. Cheers,

@pwaller
Copy link
Owner

pwaller commented May 7, 2021

Sorry for the delayed response. Patches are welcome.

@diamant3
Copy link

diamant3 commented Oct 8, 2022

Am i right, this is the fix for this issue?

if sys.platform == 'win32':
SHARED_DIRECTORY = os.path.join(os.environ["APPDATA"], "pyfiglet")
else:
SHARED_DIRECTORY = '/usr/local/share/pyfiglet/'

@pwaller
Copy link
Owner

pwaller commented Aug 18, 2023

Can anyone confirm if this remains a problem or not? If so please write and we can reopen.

@pwaller pwaller closed this as completed Aug 18, 2023
@mixmastamyk
Copy link
Author

mixmastamyk commented Aug 19, 2023

How could the situation change with no action taken?

Quick look at the source highlighted above:

Make SHARED_DIRECTORY a tuple. Already looping over it on line 143.

Looks like a two line change maybe.

Guess not, used several times below that.

@pwaller pwaller reopened this Aug 19, 2023
@pwaller
Copy link
Owner

pwaller commented Aug 19, 2023

How could the situation change with no action taken?

I'm just trying to gauge how to spend my limited resources to try and improve things. You piping up to say something suggests this is still important to you so that's fine. If you know what needs to be done to fix it, can you send a pull request? I don't have your platform so I can't reproduce the problem or test a fix.

@mixmastamyk
Copy link
Author

I will try to take a look this coming week. Unfortunately kinda busy and don't think I've used this for a few years, but I put it on my todo list since it is probably pretty easy.

@peterbrittain
Copy link
Collaborator

Given that the exact location of the figlet fonts will probably vary across systems, it might be an idea to add this as a '-d' option to the command line (specifying an extra font directory) instead of as a hard-coded location.

@pwaller
Copy link
Owner

pwaller commented Sep 1, 2023

Heads up I'm looking to ship pyfiglet 1.0.0. There's still time if someone wants to try and get a fix in.

@diamant3
Copy link

Hello, Can i take this issue?

@pwaller
Copy link
Owner

pwaller commented Jan 11, 2024

@diamant3 that would be appreciated :)

@diamant3
Copy link

thanks for the reply!, I will make a PR later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants