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
Weird font glitch with nerd font icons #550
Comments
There is no way to guarantee that a glyph will line up with the left edge of a cell. Whether it does or not depends on various things like how the glyph is defined in the font, the cell size, the glyph size in the font, etc. For this kind of thing, it is better to use geometric shapes rather than font glyphs. You can see an example of that in the kitty screenshot in the readme (look at the vim statusbar). So instead of using whatever codepoint you use for the filled D glyph instead use the U+e0b0 codepoint which will give you a filled triangle that is always properly aligned regardless of font. Similarly U+e0b2 will give you a filled left point triangle. It is possible to similarly override the redering of whatever code point the nerd fonts use for filled D but it's not something I am interested in myself, patches are welcome. You would basically need to add rendering for the filled D shapes to box_drawing.py (similar to the triangle() function) |
Actually it turns out that generating the bezier curve to fit a D inside an arbitrary rectangle is a fun little challenge, so I think I will implement the overrides in box_drawing.py myself. |
How it looks in Kitty
How it looks in alacritty
I tried it with a lot of different nerd patched fonts, mono and non-mono, and all nerd font icons were shifted to the right by a bit. The shifting is there in an out of vim. In the screenshot below, it shows the icon with the cursor on top of it.
I can't find anything in the docs on fixing this. I'm wondering if there is something I missed which would can be added to my kitty.conf to fix this, or if you have any suggestion on trying something else. Any help is appreciated, thanks.
Btw, really great job on the terminal, super smooth and even with the small glitch above, it looks really nice.
The text was updated successfully, but these errors were encountered: