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

Vertial Mis-Alignment of Characters #2

Open
erwin opened this issue Sep 8, 2022 · 3 comments
Open

Vertial Mis-Alignment of Characters #2

erwin opened this issue Sep 8, 2022 · 3 comments

Comments

@erwin
Copy link

erwin commented Sep 8, 2022

I'm using the Hack Nerd Font. I've checked with kitty's --debug-font-fallback that it contains glphys for every unicode codepoint that I'm using.

Somehow the vertical alignment of some glphys is off.

Here is the .SVG after embedding the Hack Nerd Font
image

Notice how the alignment of some of the glphys is off...
image

image

Yet in the terminal with the same Hack Nerd Font everything is aligned properly.
image

I also tried this with FiraCode, but the results were about the same.

It's almost like the SVG can't find the glphy from these codepoints and is grabbing them from a different font, or maybe just rendering some codepoints at the wrong size...

SVG with Hack font embedded

220908-5Oey

SVG before font embedding

220908-5Oey-nofont

ASCIICast used to produce SVG

220908-5Oey.cast.zip

Font file embedded in SVG

Hack Regular Nerd Font Complete Windows Compatible.zip

@miraclx
Copy link
Owner

miraclx commented Sep 13, 2022

Hi @erwin, svgembed is not under active maintenance, and since I don't personally use it again, I'm unable to help investigate this. Although, svgembed doesn't do much besides literally just embedding the font inside the SVG file. So it's either the SVG viewer doesn't know what to do with the those glyphs or the terminal is doing more than the font allows so you don't notice the discrepancy in the terminal. Either way, unfortunately, there's no fix for this from inside svgembed as the issue is not from this tool.

@erwin
Copy link
Author

erwin commented Oct 11, 2022 via email

@miraclx
Copy link
Owner

miraclx commented Oct 19, 2022

It could be that the terminal supports ligatures, and how svgembed's informs the SVG viewer about the font doesn't tell it to support ligatures. I'm not sure if this is even a thing in the context of most viewers, like browsers. But if you can find any information or perhaps even get a working patch, I'd accept a PR.

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

2 participants