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

Powerline symbols are incorrect #33

Closed
iirelu opened this issue Aug 30, 2015 · 134 comments
Closed

Powerline symbols are incorrect #33

iirelu opened this issue Aug 30, 2015 · 134 comments
Assignees

Comments

@iirelu
Copy link

iirelu commented Aug 30, 2015

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.

@chrissimpkins
Copy link
Member

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
Copy link
Member

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

@amfl
Copy link

amfl commented Aug 30, 2015

I am also experiencing this on Windows with PuTTY.

Image

@chrissimpkins
Copy link
Member

Thanks @amfl . queued up!

@chrissimpkins
Copy link
Member

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...

@kejadlen
Copy link

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.

@theckman
Copy link

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.

@jezeniel
Copy link

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

@shosca
Copy link

shosca commented Aug 31, 2015

Same alignment issue in Win10 + msys2 mintty

@Binarytales
Copy link

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.

@justinta
Copy link

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.

@chrissimpkins
Copy link
Member

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)

@shosca
Copy link

shosca commented Sep 1, 2015

Screenshot with test font win10 + msys2 mintty

and gnome-terminal on archlinux

@chrissimpkins
Copy link
Member

@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.

@eriol
Copy link

eriol commented Sep 1, 2015

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

@amfl
Copy link

amfl commented Sep 1, 2015

PuTTY on Windows 8 with test font
image

@alerque
Copy link
Member

alerque commented Sep 1, 2015

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?

@Binarytales
Copy link

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

@chrissimpkins
Copy link
Member

@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.

@kejadlen
Copy link

kejadlen commented Sep 1, 2015

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

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

@RobinMcCorkell
Copy link

Similar results with xfce4-terminal. First 2.010:

hack-regular

Then the version in development as of now (PL1):

hack-pl1

Loving the font by the way!

@m42e
Copy link

m42e commented Sep 2, 2015

The test font on Windows 7, mintty, cygwin:

vim2

@chrissimpkins
Copy link
Member

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

@Binarytales what do you mean by 'strange'?

@chrissimpkins
Copy link
Member

Test build 2 is available (PL2) with changes in the horizontal spacing of the solid arrowheads and increase in size of the solid arrowheads. Let me know what you think. Thanks for all of the screenshots. These have been very helpful.

Download Link
Hack-Regular-PL2.ttf

@m42e
Copy link

m42e commented Sep 3, 2015

Better, but not perfect :)

Thank you for the font, it is a real improvement for my eyes 👍

The shell promt works nicely, but in vim there seems to be a very small gap.

vim3

vim4

@Irubataru
Copy link

Just want to chime in and say that the fonts in the pull request also lines up correctly on my setup

archlinux, urxvt(v9.22), vim (v7.4 p1689)

@ghost
Copy link

ghost commented May 12, 2016

my setup (same as up above earlier): ubuntu 14.04 / fish shell / fisherman / agnostertheme / font size 12

@chrissimpkins
Copy link
Member

Hack should not be removed of their repo

I submitted versions to them initially and it took a great deal of time for the PR’s to be accepted so I stopped. This isn’t a criticism, I understand this well. It just wasn’t serving our release schedule. I think it is useful to include them there. Many find that site when they are looking for new fonts with Powerline glyphs and I would like to maintain our sets as part of their releases even if older versions of the fonts.

@chrissimpkins
Copy link
Member

@iirelu Thank you Anna!

@stefan-kern Thank you Stefan!

It sounds like we may have an approach for Linux/FreeType. Have either of you modified your default font-config settings on your platforms?

@aruhier
Copy link

aruhier commented May 12, 2016

@chrissimpkins Ok, I get it. Sorry if it looks like I by-passed you, that's really not my goal ;)

@chrissimpkins
Copy link
Member

@Anthony25 Absolutely no problem at all. That decision is up to the Powerline developers and the community of users. It's not mine to make.

@polarathene
Copy link

I'll test this at work today with iTerm2 on OSX :) fingers crossed

@polarathene
Copy link

@chrissimpkins

11pt:
11pt

12pt:
12pt

13pt:
13pt

14pt:
14pt

None are perfectly aligned but they're only off by a minor amount, barely noticeable from a distance on a retina screen.

12pt prior to @Anthony25 PR:
12pt prior

12pt fix I did with GlyphsApp:
my 12pt fix

My fix for the 12pt only works on 12pt(I don't know font design well enough to know if there is a way to fix that), it was done through many manual tweaks until it looked right. At other sizes it breaks similar to original and PR.

I'm using a zsh theme called Powerline9k, not the python Powerline lib. I don't think the methods to render the glyphs would be too different, but there is a slight chance it's not the same.

@aruhier
Copy link

aruhier commented May 13, 2016

Could it be because I didn't patch the fonts with font-line? I mean I took the ttf of your last release, but the glyphs replaced by the Powerline script are not, are they?

Edit: my question wasn't clear. I meant: do the glyphs replaced by powerline need to be patched with font-line?

@chrissimpkins
Copy link
Member

@polarathene Thanks for posting these Brennan. The new patched version looks good on OS X. Would the shapes/metrics in the patched version be acceptable based upon your view on the screen c/w the patch that you implemented?

@chrissimpkins
Copy link
Member

@Anthony25

do the glyphs replaced by powerline need to be patched with font-line

No not at all. font-line modifies the default line spacing in the font. It is not a patching tool. We have discussed a tool that will patch new glyphs into the font but it hasn't been developed yet. As I understand the Powerline font patching script, there is a comparison of the metrics in the target font and the released Powerline glyph set. The Powerline glyphs are appropriately scaled and merged into the target fonts. There should not be any line spacing adjustments with that script and that is both intentional and a good thing.

@polarathene
Copy link

polarathene commented May 14, 2016

@chrissimpkins Just saw these pictures at home on my non retina screen(external laptop screen on linux). They appear blurry and you cannot clearly see the differences too well(Clicking them for fullsize helps).

On OSX I'm sure the PR patch is fine :) Not as many users would be as nitpicky as I am with the tiny (couple of pixels) vertical offsets. 14pt is really the only one that would bother me(right prompt specifically, left prompt looks fine). That may just be due to kerning(I think that is the term), similar to other cases where instead of pushed to the right it was pushed to the left causing a gap.

I can always send over my modified version for 12pt if it'd be of any help.

@chrissimpkins
Copy link
Member

@polarathene Thanks Brennan. I think that we are good with these comments. I really appreciate your feedback.

@chrissimpkins
Copy link
Member

Anyone else in the thread have comments on how the patched version looks in their Powerline or Powerline variant?

@chrissimpkins chrissimpkins added this to the v2.021 milestone May 16, 2016
@eoli3n
Copy link

eoli3n commented Jun 15, 2016

System : Archlinux
Aur package : ttf-hack-powerline-git
.Xresources : https://github.com/eoli3n/dotfiles/blob/master/.Xresources.d/rxvt-unicode

screen

I xrdb .Xresources and updated font cache

@nharward
Copy link

nharward commented Nov 8, 2016

On the issue of symbols appearing as too short (Linux): in my case it turned out that my high-density screen on a newer laptop was causing fonts not to display properly, as fontconfig appears to not pick up DPI correctly from the X server. Putting this in $HOME/.config/fontconfig/conf.d/10-hidpi.conf resolved the issue and now it looks great:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

        <match target="pattern">
                <edit name="dpi" mode="assign">
                        <double>276</double>
                </edit>
        </match>

</fontconfig>

Replace the 276 with the correct DPI of your display. Kudos to all the fine folks behind powerline and the fonts that make it look great.

@nullne
Copy link

nullne commented Feb 4, 2017

I am wondering why there is a red block and yellow line on my status line?

This is mine: screen shot 2017-02-04 at 1 23 18 pm

This is normal: screen shot 2017-02-04 at 1 23 32 pm

@aruhier
Copy link

aruhier commented Mar 23, 2017

My pull request has finally been merged into powerline-fonts: powerline/fonts#172

It should fix the weird rendering.

Edit: well, not entirely fix it, according to @polarathene screenshots, but it largely improves it on <=1080p displays.

@chrissimpkins
Copy link
Member

PR in #234 that is aimed at Linux and Win Powerline glyph users. Would greatly appreciate your feedback on the test font files there to confirm that there is an improvement in rendering that addresses these issues on those platforms and doesn't create significant new issues on those or OS X.

Thanks!

@chrissimpkins chrissimpkins removed this from the v2.021 milestone Jun 28, 2017
@rage311
Copy link

rage311 commented Jul 7, 2017

I tested the HackTest4 attachment from PR #234 and it has fixed the issue for me entirely -- both with the agnoster theme in zsh and the powerline (airline, really) in vim.
anypaste_2017-07-07_10 00 55

My system:
Arch Linux
rxvt-unicode 9.22
freetype 2.8

.Xresources file:

URxvt.font:         xft:Hack Test 4:pixelsize=12:antialias=true
URxvt.letterSpace:  -2

!-- Xft settings -- !
Xft.dpi:        96
Xft.antialias:  true
Xft.rgba:       rgb
Xft.hinting:    true
Xft.hintstyle:  hintslight
Xft.lcdfilter:  lcddefault
Xft.autohint:   0

Please let me know if I can provide any other relevant information. Thanks for this font, too. I'm a big fan of it.

@chrissimpkins
Copy link
Member

chrissimpkins commented Jul 7, 2017

👍 👍 👍

@rage311 thank you! This PR will be merged in the v3.0 release.

cc: @iamjamestl see #33 (comment)

Thanks for this font, too. I'm a big fan of it.

Our pleasure!

@chrissimpkins
Copy link
Member

chrissimpkins commented Sep 11, 2017

We are planning to merge the changes from @iamjamestl in #234 as part of an upcoming release. Once he has rebased his modified glyph source on our new source code (part of the v3.0 release transition) I will build files with our new build tool chain and notify all here so that you can give them a try. @iamjamestl has performed a great deal of testing on Linux. It would be very helpful to have feedback from OS X and Windows users of Powerline/Powerline style terminal UI's that use these glyphs as we prepare for the release.

Will notify here when they are available for anyone who is willing to help with testing. Thanks in advance! And thanks to @iamjametl for the extremely detailed attempt in #234 to fix these problematic glyphs! The images that he posted there look fantastic. Hope these changes work for all.

@chrissimpkins
Copy link
Member

New development build files with @iamjamestl Powerline glyph changes are now available in the dev branch.

Desktop files are available on the path build/ttf and web font files are available on the path build/web.

The current build files are labeled Version 3.000; 1e373f5-dev

These changes should significantly improve rendering of Powerline glyphs on Linux and Windows platforms. Please let us know if you have any problems. These changes will be released as part of our upcoming version 3.0 release.

CodingMarkus pushed a commit to CodingMarkus/DockerHackFont that referenced this issue Oct 9, 2018
These changes to the Powerline separator glyphs is the result of
studying the ones from DejaVu Sans Mono and Fantasque Sans Mono which
appear seamless, without gaps or points extending above and below the
line.  We make the outlines slightly larger than the bounding box to
cause the renderer to overlap the character with the surrounding ones,
eliminating the gaps.  Experimentation with different sizes and shapes
was performed in source-foundry#234 under several renderers and applications to try to
get the most consistency across platforms.

Closes source-foundry#33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests