Allow loading fonts automatically from /usr/share/figlet
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,
Sorry for the delayed response. Patches are welcome.
Am i right, this is the fix for this issue?
https://github.com/pwaller/pyfiglet/blob/a90585a72b2e646762633192a18a86eee4162a58/pyfiglet/init.py#L58-L61
Can anyone confirm if this remains a problem or not? If so please write and we can reopen.
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.
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.
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.
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.
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.
Hello, Can i take this issue?
@diamant3 that would be appreciated :)
thanks for the reply!, I will make a PR later