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

fnt preview should use sixel for higher resolution images #36

Open
hackerb9 opened this issue Mar 27, 2024 · 5 comments
Open

fnt preview should use sixel for higher resolution images #36

hackerb9 opened this issue Mar 27, 2024 · 5 comments

Comments

@hackerb9
Copy link

hackerb9 commented Mar 27, 2024

The font preview is a nifty idea, but the resolution is too low. I don't know much about chafa, but I thought it handled sixels which would allow for a crisp bitmap display in the terminal. Perhaps there is something fnt needs to do to enable it?

Here is an comparison with using sixels, via the ImageMagick convert command, to view a font on the command line in a terminal that handles graphics. (Xterm).

Comparison of fnt preview and ImageMagick font display

convert -list font | grep Font | grep -v Noto
convert -size 800x -font Iosevka label:'ABC xyz' sixel:- ; echo
convert -size 800x -background orange -fill white -font Sudo-Regular label:$'\U2022 ABC xyz \U1F5D1' sixel:- ; echo

But that only works for fonts that are already installed. My hope is that fnt will be able to do the same thing for any font.

@crpb
Copy link
Contributor

crpb commented Sep 6, 2024

I only use urxvt so thats hard for me to write.
@alexmyczko add "help needed/wanted" as a tag.

@crpb
Copy link
Contributor

crpb commented Sep 7, 2024

So i tried in kitty which looks like the right part of your screenshot.
But i couldn't get that what you did there with convert working here in either kitty or urxvt.

But i created a list with all fonts currently missing a preview so we will let @alexmyczko generate them at least.

Maybe you could provide some examples for convert that could actually work with fonts installed via fnt?
I can't find iosevka or sudo so that already would fails here. And with other fonts i get convert-error messages in kitty and xterm+urxvt don't care at all and the output is blank.
And fyi, imagemagick can be really buggy. So that might not be the best tool to integrate at all.
I could just a option to let you open up sensible-browser or xdg-open to the picture or put it underneath the picture so people could click on it to see that in the browser instead.

@crpb
Copy link
Contributor

crpb commented Sep 8, 2024

btw, kitty does it like a charm in comparisment to the best terminal emulator 🙉
maim_20240908-173655

@crpb
Copy link
Contributor

crpb commented Sep 8, 2024

Ahh kitty doesn't do sixels.. yakuake looks as good as this.

@alexmyczko
Copy link
Owner

what would it do on terminals that do not support sixel rendering?

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

No branches or pull requests

3 participants