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

Various enhancements / fixes #56

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

foxharp
Copy link

@foxharp foxharp commented Jan 4, 2025

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!

foxharp added 12 commits January 3, 2025 08:11
This prevents sxiv from failing.  Also, remove -flatten from magick
args, since it does nothing in this context.
nsxiv isn't in Debian or Ubuntu (sxiv is), and the convert --> magick
transition hasn't happened everywhere either.  So be lenient.
No need to maintain a PID file anymore.
The window manager will probably do a better job of positioning than
we will.
Specifically, add characters which are often confused if their shapes
are too similar.
we shouldn't need kill -9, certainly not on ourselves
any viewer that supports inotify for updating the image view should work.
the viewer could even be specified in with a config variable, but
there would need to be a separate var for its options.  gets messy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant