pyfiglet icon indicating copy to clipboard operation
pyfiglet copied to clipboard

Allow loading fonts automatically from /usr/share/figlet

Open mixmastamyk opened this issue 5 years ago • 11 comments

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,

mixmastamyk avatar Jan 04 '21 04:01 mixmastamyk

Sorry for the delayed response. Patches are welcome.

pwaller avatar May 07 '21 16:05 pwaller

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

https://github.com/pwaller/pyfiglet/blob/a90585a72b2e646762633192a18a86eee4162a58/pyfiglet/init.py#L58-L61

diamant3 avatar Oct 08 '22 10:10 diamant3

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

pwaller avatar Aug 18 '23 21:08 pwaller

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.

mixmastamyk avatar Aug 19 '23 01:08 mixmastamyk

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.

pwaller avatar Aug 19 '23 15:08 pwaller

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.

mixmastamyk avatar Aug 25 '23 00:08 mixmastamyk

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.

peterbrittain avatar Aug 25 '23 07:08 peterbrittain

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.

pwaller avatar Sep 01 '23 16:09 pwaller

Hello, Can i take this issue?

diamant3 avatar Jan 11 '24 11:01 diamant3

@diamant3 that would be appreciated :)

pwaller avatar Jan 11 '24 20:01 pwaller

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

diamant3 avatar Jan 11 '24 22:01 diamant3