Hack icon indicating copy to clipboard operation
Hack copied to clipboard

Powerline symbols are incorrect

Open iirelu opened this issue 11 years ago • 134 comments

Under Hack:

Under a font with proper powerline symbols (in this case Fantasque Sans):

Note how Hack's symbols don't properly fill the entire height of the character, whilst Fantasque's ones do.

iirelu avatar Aug 30 '15 07:08 iirelu

Thank you! I have been looking for feedback from Powerline users. @corelon and I worked on the Powerline glyph alignment and it seemed to have proper vertical alignment on OS X but we haven't looked into this on other OS. Can you let me know what platform you are on?

chrissimpkins avatar Aug 30 '15 11:08 chrissimpkins

Looks like the sidebearings (horizontal alignment) are a bit off in your images as well...

chrissimpkins avatar Aug 30 '15 11:08 chrissimpkins

I am also experiencing this on Windows with PuTTY.

Image

amfl avatar Aug 30 '15 11:08 amfl

Thanks @amfl . queued up!

chrissimpkins avatar Aug 30 '15 12:08 chrissimpkins

Here is the alignment of the Powerline glyphs in Hack (with 'Ac1' added for comparison):

powerline-glyphs

For the horizontal positioning issues: The arrow heads are at the edge of the em box. I think we need feedback from the Powerline developers about the dimensions that they are using to position the rectangular colored areas. Those seem to push into adjacent Powerline glyphs.

For the vertical positioning issues: This is a simple fix. We just need to nudge the arrow heads up. The problem is that the images from Windows posted by @amfl and OSX by @theckman (#30) are much closer to the midline and will likely be pushed too high with the changes needed to align the glyphs on your system.

I think that this will be a bit of trial and error...

chrissimpkins avatar Aug 30 '15 12:08 chrissimpkins

I'm seeing this issue on OS X as well:

screen shot 2015-08-30 at 12 49 16 pm

Would be glad to help out by debugging/testing if you need it.

kejadlen avatar Aug 30 '15 19:08 kejadlen

I'd be more than happy to help out here. It looks like my system, for some reason, has padding around the top and bottom of the text to make the color equal on both sides. You can see this in people's screenshots. Their text is closer to the bottom of the boxes than the top.

Where is everyone using powerline? What shell / terminal application? I'm using this repo (https://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme) at 561c0009e2adf14e49977b98f22a9115f3e87a09. It is worth noting that my vim setup looks pretty much the same as my zsh one.

Edit: I just pulled my theme down to the version available on master with no change.

theckman avatar Aug 30 '15 20:08 theckman

I am experiencing the same problem stated above. I use termite for my terminal emulation on manjaro linux.

jezeniel avatar Aug 31 '15 12:08 jezeniel

Same alignment issue in Win10 + msys2 mintty

shosca avatar Aug 31 '15 12:08 shosca

I'd love to help out with testing this issue and any fixes you may have.

Here is Hack at 14px on the Terminal.app OSX 10.10.4 on a Retina display:

hackterminal

And here it is on the same system but this time in iTerm2:

hackosxitem2

Unfortunately, you can see that they treating the vertical positioning differently.

If you need any other screenshots, different font sizes, more zoomed in, screenshots with an on screen rule or anything else I am more than happy to do that.

Binarytales avatar Aug 31 '15 16:08 Binarytales

I'm seeing the same thing, however, I'm not using powerline outside of Vim. I've created a custom tmux theme using powerline glyphs and I'm using Agnoster theme from oh-my-zsh.

With Hack: l

Using Literation Sans Mono Powerline: screen shot 2015-08-31 at 12 40 31 pm

Agnoster oh-my-zsh theme: screen shot 2015-08-31 at 12 56 35 pm

Vim Powerline: screen shot 2015-08-31 at 12 57 22 pm

Thanks for your work on this. Let me know if I can help you test this at all or you need more info.

justinta avatar Aug 31 '15 18:08 justinta

First iteration of the Powerline glyph alignment changes (PL1).

Replace the Hack regular set with this one and continue to use the name 'Hack' to define the font.

Download test ttf

Positions

Branch arrow (U+E0A0)

  • top left (279, 1783)
  • bottom left (279, -267)

LN glyph (U+E0A1)

  • top (290, 1783)
  • bottom (290, -270)

R solid arrow head (U+E0B0)

  • top corner (290, 1783)
  • bottom corner (290, -270)

R narrow stroke arrow head (U+E0B1)

  • top corner (283, 1731)
  • bottom corner (283, -322)

L solid arrow head (U+E0B2)

  • top corner (936, 1783)
  • bottom corner (936, -270)

L narrow stroke arrow head (U+E0B3)

  • top corner (937, 1731)
  • bottom corner (937, -322)

chrissimpkins avatar Sep 01 '15 03:09 chrissimpkins

Screenshot with test font win10 + msys2 mintty

and gnome-terminal on archlinux

shosca avatar Sep 01 '15 04:09 shosca

@shosca getting close vertically. The glyph sizes are too small on your system. It looks like the arrowheads need to be larger. Let's see a few more examples and we can try again.

chrissimpkins avatar Sep 01 '15 04:09 chrissimpkins

gVim on Debian Stretch with test font hack-powerline-align

eriol avatar Sep 01 '15 04:09 eriol

PuTTY on Windows 8 with test font image

amfl avatar Sep 01 '15 04:09 amfl

I came here to file this same issue report. I am an Arch Linux user currently using Liberation Mono for Powerline. In that font and many others that I patched using the available font patch tools, the powerline arrow glyphs are always 100% of the line height. I don't understand why this should be a matter of trial and error and adjusting. Running the font patcher does a bunch of math on the existing font metrics to find the proper height and width for these glyphs. Can you not backport those metrics into the base font files?

alerque avatar Sep 01 '15 05:09 alerque

Here is Terminal.app top and iTerm2 bottom. OSX 10.10.4.

Font size 14px:

screen shot 2015-09-01 at 10 56 02 am

And again here at font size 48px. Not something most people would ever use but iTerm2 is acting very strange and I thought maybe this "zoomed" in view might help with debugging. Let me know if this is helpful and I'll remember to always do this in future.

Font size 48px;

screen shot 2015-09-01 at 10 55 26 am

Binarytales avatar Sep 01 '15 09:09 Binarytales

@alerque Are you referring to the official script released on the Powerline repository? I looked into this a few months ago and my recollection is that I came across an issue report thread that pushed me to avoid the script. My sense was that this script is no longer in general use because it failed to appropriately import the glyphs in attempts by a number of others.

Am I mistaken? Can you provide more detail on the metrics that it provides? My goal is to adjust the Powerline glyphs to the Hack metrics and maintain them in the general release rather than generate a separate patched build.

chrissimpkins avatar Sep 01 '15 12:09 chrissimpkins

Terminal.app on 10.10.5 with a font size of 10:

screen shot 2015-09-01 at 7 46 27 am

kejadlen avatar Sep 01 '15 14:09 kejadlen