source-foundry / Hack

A typeface designed for source code
http://sourcefoundry.org/hack/
Other
16.39k stars 613 forks source link

\ue0b1 & \ue0b3 is not aligned with \ue0b0 & \ue0b2. Powerline glyphs #445

Closed MindTooth closed 6 years ago

MindTooth commented 6 years ago

Hi,

Thank you so much for the Hack font. Been my preferred for years. 👍

The issue I'm reporting today came to be because I'm to update my vim-airline theme.

At first I though I needed to change the symbol, and doing tweaks, but as you can see from the screengrab[1], they don't align. When loading Vim, you can also see on the left[2] that the arrow is not centered between the text.

I first noticed the issue with Nerd-Font's version of Hack. So I changed to see if this were an issue with the original font, which is confirmed with [1] & [2].

If you need more info, just say so, and I'll add more. Whenever possible, please take a look.

[1]

screen shot 2018-07-28 at 13 22 31

[2]

screen shot 2018-07-28 at 13 33 39
chrissimpkins commented 6 years ago

Thanks for the report! What platform are you on?

MindTooth commented 6 years ago

My bad totally.

screen shot 2018-07-28 at 14 17 33
chrissimpkins commented 6 years ago

No worries! Thanks for the additional information. Can you show me a font that includes the desired appearance? As I understand it, you want to see the thin arrowheads centered between adjacent glyphs. The unknown (to me) here is whether the current alignment is because of other horizontal alignment needs for the glyphs.

chrissimpkins commented 6 years ago

Here is where we are in the design source at commit 3e7343e1a244c253ce84f0b75516cc42ea8d136b (v3.003 release):

rwsxn-image

w1sxa-image

qmjf3-image

m62mm-image

Looks like an issue with the rendering in your environment. Unclear why both U+E0B1 and U+E0B3 both appear to be shifted to the right. I can confirm that the design on the thin arrowheads extends slightly wider on the side away from the arrowhead point than the thicker arrowheads do but that doesn't explain why both left pointing and right pointing would shift to right only? Not sure what is going on there. We can take a look at the Powerline glyph dimensions in other sets if you can find a set that renders as expected for you.

MindTooth commented 6 years ago

You know what, it seems to be an issue with kitty. And I've been testing with Terminal.app, MacVim, and they works fine. At least thank you for taking the time to provide such an elaborate reply. I should have done more testing.

If I humble ask for your attention, @kovidgoyal, care to chime in?

Kitty

screen shot 2018-07-28 at 21 08 46

MacVim

screen shot 2018-07-28 at 21 34 05

Terminal.app

screen shot 2018-07-28 at 21 33 44
chrissimpkins commented 6 years ago

No worries. Let us know if there is anything that we can do on our end.

kovidgoyal commented 6 years ago

As I've said many times before, the whole idea of using fonts to draw glyphs that line up with cell boundaries is totally broken. It will not work in different programs on different platforms at different sizes, with different fonts. Witness the hacks @chrissimpkins has to do like extending characters outside the bounding region and hoping the font renderer renders it in a way that still looks nice. Because of the way kitty is designed to work that particular hack will not work well with it -- when it sees a character that does not fit in the bounding box it does not just let it overflow into its neighbors or simply clip it at cell boundaries, instead it decreases the font size and renders the glyph to fit in the box.

Fonts are designed to be scalable, which means they cannot be used for fixed layout rendering. If you want to do fixed layout rendering, use the unicode box drawing characters for it, that's what they are designed for.

kitty in addition to supporting the standard box drawing characters also supports four extra powerline separators from the unicode private area. u+e0b0 u+e0b2 u+e0b4 u+e0b6 these are guaranteed to always line up with cell boundaries. As for the particular character you are discussin here, I'd suggest using  ⧽ (u+29fd) instead which is a recognized unicode symbol and therefore is unlikely to be implemented in fonts using hackery and so will look better in kitty.

MindTooth commented 6 years ago

Thank you for the elaborate reply, and the suggestions. I hope that this will be to use for others in the future.

I'll be closing this for now. Once again, big gratitude to the both of you.

chrissimpkins commented 6 years ago

good luck @MindTooth!