Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Great script! Thanks for writing and sharing it. It was exactly what I needed this week.
I don't really expect you apply all of these changes I've made (though I don't think I've broken anything), but I'm including them all in the pull request so you can see them all easily.
Main changes: I tend to prefer pre-packaged programs, and since current Debian and Ubuntu don't include "nsxiv" or "magick", but do still have sxiv and convert, I've made the code adaptable for those. It will also work with "feh" as the viewer.
The fzf search string is now preserved after you select a font, so you don't need to keep retyping it.
The default preview text now includes some sequences of characters that are frequently confused in a poorly designed font (e.g., "1lI" -- and I see that github has chosen a terrible font!). Since I found fontpreview while trying to choose a better programming font, these are important.
A small change to the code eliminated the sxiv failure that I think was forcing the use of nsxiv. So some of the viewer restart code could go away.
Also, some usage errors weren't being caught. try:
./fontpreview -i some-font-file.otf
for instance. I got:
./fontpreview: line 58: -size: command not found
Fixed now.
If you'd like me to rework something, or put together a different pull request leaving some changes out, let me know. And obviously if you want to ignore it altogether, that's fine too. ;-)
Thanks again!