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 #43

Closed
amadeus opened this issue Dec 18, 2012 · 51 comments
Closed

Powerline symbols #43

amadeus opened this issue Dec 18, 2012 · 51 comments

Comments

@amadeus
Copy link

amadeus commented Dec 18, 2012

Understandably I am in the minority with this issue, but I figured I would post it here to get your thoughts.

I use Source Code Pro in MacVim, but more importantly I use with a special plugin called Powerline that has support for some custom glyphs that provide an overall nicer user experience.

The Powerline project includes a font patching tool to add these glyphs manually, however it has some issues when placing them, as can be seen by the screenshot below:

bug-tweak

Notice how the arrows and Line Number glyphs seem to get chopped off at the bottom due to their vertical alignment being a tad lower than what should be expected?

Since I don't know much about font development, here's a link by the project author that explains the issue.

powerline/powerline#14 (comment)

Sounds like the potential fixes either include some custom hackery with the font patcher to fix the glyph alignment or a potential fix in Source Code Pro itself, however it could also be the reason for it not working could be an intentional design piece on your own. He also mentioned potentially submitting a patch that includes the glyphs built in, however I am not sure whether you guys would even be open to that in the first place.

@miguelsousa
Copy link
Member

Seems related to #16. The best solution is to have these glyphs added to the fonts. Is this something you want to contribute?

@Lokaltog
Copy link

I'd be happy to fine-tune the glyphs and open a pull request later if you want to include the glyphs in Source Code Pro.

@Lokaltog
Copy link

I've created a version of Source Code Pro with the patched glyphs here.

Here's a list of the glyphs that are included.

@frankrolf
Copy link
Member

I agree with @miguelsousa, for best user experience it would be a good idea to add the glyphs to SCP.

The font patcher is currently adding the same glyphs (same alignment, same size, same thickness, same design) to any font being patched, which makes for different results. Additionally, re-generating the font binary via the font patcher might break unexpected things.

Thank you @Lokaltog for uploading the patched SCP, this is a good point to start from. We would now need to add the same glyphs to all the other weights as well.

Before doing this; I have several questions:

Thanks!

@Lokaltog
Copy link

These glyphs are for the upcoming version of Powerline, so they have been changed a bit. They have been redrawn, and the code points have been moved to the Private Use Area. The F and T glyphs have been removed and won't be included at all in the new version of Powerline.

I wasn't aware that any padlock glyphs already existed in Unicode, and I haven't seen any fonts with pointing triangles that fill the entire height and width of the font. I had the impression that the PUA was the best area to put these glyphs, but please let me know if you think that they would be better suited at another location. A criticism of the previous version of Powerline was that its glyphs were located somewhere other than the PUA.

It would be awesome if anyone who knows anything about font design could polish the glyphs to fit perfectly with the SCP font design and for bold/italic fonts, since the glyphs are basically just stretched and moved to fit the dimensions of the font being patched. I know little about font design and the patcher is mostly a quick way of getting decent looking symbols for Powerline.

My goal with this version of Powerline is to get as many coding fonts as possible to include the new glyphs, and to be able to link to those fonts in the powerline-fonts repo. Ideally users won't have to patch fonts at all but rather just download pre-patched fonts from the original authors.

The specification of the glyphs/code points that are going to be used in Powerline is available in the docs.

@amadeus
Copy link
Author

amadeus commented Feb 6, 2013

Hey Guys,

Curious if there has been any more movement on this issue? There's a custom version that's out, but it would be great to have it standardized within the font itself.

@pauldhunt
Copy link
Contributor

We are considering adding the powerline symbols, but it will be a (short?) while before we touch the fonts again as I am currently working on Source Sans and preparing for a trip to India to present some workshops there during the month of March.

@amadeus
Copy link
Author

amadeus commented Feb 6, 2013

Awesome, thanks for the update! Really appreciate it!

@haguro
Copy link

haguro commented Feb 25, 2013

Just as an FYI and to save you few clicks, the glyph table (and the rest of the documentation) seem to have been moved here ;-)

@yacoob
Copy link

yacoob commented Jul 6, 2013

@pauldhunt any news? :)

@pauldhunt
Copy link
Contributor

no news. busy with other projects at the moment.

@neersighted
Copy link

Bump?

@pauldhunt
Copy link
Contributor

@Lokaltog do you want to submit a pull request for this? /cc @neersighted

@Lokaltog
Copy link

I apologize for not responding to this issue, I haven't worked on Powerline for quite a while as I'm no longer using it myself, and I've moved on to work on other projects. A patched version of Source Code Pro has been submitted to the powerline-fonts repo and can be found here. Note that I haven't tried this font myself and I don't know if the glyphs are properly adjusted for the font.

I'm not sure how to proceed here, it's been a while since I worked with fontforge. Should I submit a patched TTF to the repo? Is it a big task for you guys to copy-paste the required glyphs from the font in the powerline-fonts repo? I'm not sure if fontforge may strip away some metadata or export it improperly or something like that, so I just want to be sure how to submit the PR properly before doing any work on the font.

@pauldhunt
Copy link
Contributor

@Lokaltog if doing this will not benefit you, then hopefully someone who is actively interested in this issue will do the work. otherwise, it seems like there is not too much interest in this happening, although what would be a good way to gauge how many users would benefit from adding these symbols to the fonts? /cc @neersighted

@Lokaltog
Copy link

@pauldhunt Quite a lot of people use either Powerline or one of the derivatives like airline for vim, which depend on these symbols. Other fonts like Terminus and Pragmata Pro have added "native" support for the symbols by popular demand to avoid having patched fonts elsewhere that may become outdated, so the demand and benefit of adding the symbols to the font is definitely there. But I think I agree that this issue is probably best left to the someone who actively uses both the font and Powerline.

In the meantime there is an older version of Source Code Pro available in the powerline-fonts repo, and anyone subscribing to this issue can download it here: https://github.com/Lokaltog/powerline-fonts/tree/master/SourceCodePro

@neersighted
Copy link

I'd be willing to give it a swing sometime. I use the patched Source Code Pro (Sauce Code Powerline? Is that a joke?!), but the glyphs are off at smaller (<12) font sizes.

@pauldhunt Not quite sure how to contribute, so tips are welcome. If you'd like to try it yourself, the symbols are in PowerlineSymbols in the Lokaltog/powerline-fonts repo.

@miguelsousa
Copy link
Member

Sauce Code Powerline? Is that a joke?!

No. Source is a trademarked and reserved name, which derivative fonts cannot used. It's all spelled out in the license.

@robb
Copy link

robb commented Jul 6, 2014

I would love to see this happen, but I have zero experience in working on fonts.

@choco
Copy link

choco commented Aug 30, 2014

The patched version in the Lokaltog powerline-fonts repository isn't usable. Whoever made it changed the vertical alignment...

I patched a version but the powerline symbols look good only on my font size (12pt) and official Terminal app (OSX). Official support for this would be huge, but I don't know if it's really feasible :(

@whitneyit
Copy link

I find the glyphs for Powerline working quite well in cygwin however, the glyphs for nerdtree don't seem to be working.

@pauldhunt
Copy link
Contributor

I’m looking into this...
so it’s just 7 glyphs, right?

@adrientetar
Copy link

@Lokaltog Isn't the whole issue about box drawing characters having "weird metrics" as the issue on the other repository emphasizes? Is it something wrong with Source Sans Pro?

@Lokaltog
Copy link

Lokaltog commented Oct 3, 2014

Yep, it's been incredibly difficult finding a reliable way of making correctly sized glyphs that fill the entire font bounding box. Every unique terminal emulator/OS/font rendering/antialiasing/hinting combination seems to have their own way of calculating the bounding box of a font, which causes misalignments or gaps depending on your setup and the environment the glyphs were created on.

An example of this issue is the Input font, which recently got native support for Powerline glyphs by the font author himself. The author created the glyphs on OS X, and it looks perfect on OS X and on certain other setups, but it does look slightly misaligned on my setup (Linux).

I don't know enough about font metrics and all the maths involved in rendering fonts to tell if there's any way of fixing this issue and rendering these glyphs reliably across all platforms and configurations.

@gbitzes
Copy link

gbitzes commented Apr 15, 2015

It appears that the powerline arrows introduced in pauldhunt/SourceCodePro are not big enough to create the smooth, continuous effect we are aiming for:

wrong-powerline

This is how it looks like when using the "Sauce Code Pro" font:
correct-powerline

The difference in thickness is also visible in fontforge, in which the arrows extend to the top of the character border - new symbols:
fontforge-new

Patched font:
fontforge-patched

(The new font depicted above comes from compiling b086f07)

@pauldhunt
Copy link
Contributor

This is good to know. Are there any design guidelines for these characters?

@pauldhunt pauldhunt reopened this Apr 15, 2015
@Lokaltog
Copy link

Not really, the arrow glyphs have to be manually adjusted and tested to see if they work, and not every setup displays them correctly. Fixing the issue on one setup may end up creating another issue on other setups. I think it's impossible to get a consistent look across all setups, e.g. if you increase the glyph size to fix the antialiasing issue displayed above (the gap between the glyphs), you'll notice that the arrows end up clipped and slightly misaligned instead.

I guess you could try to make the glyphs slightly taller, just enough to close the gap and avoid the clipping, but note that if you resize the glyphs outside the font's bounding box other terminal emulators may end up either drawing the glyphs outside the bounding box (which looks even worse), or scaling the entire font to fit the size of the arrow glyphs, messing up the leading or tracking of the rest of the font.

I apologize if this is a stupid question, but could a possible solution to this issue be to add hinting to the glyphs so they line up properly? Or maybe add kerning information that moves the glyph ever so slightly to the left to close the gap?

@pauldhunt
Copy link
Contributor

for now i just extended the large edge of the big, black triangles to meet the edge of the bounding box (to the left and right), the previous version had a 20 unit gap (which is what is probably causing the blue gap). I’ll look at Sauce for other proportions.

@pauldhunt
Copy link
Contributor

The next release of the family is imminent and will include these characters, so I am closing this one for now.

@pauldhunt
Copy link
Contributor

Resolved in the latest release:
https://github.com/adobe-fonts/source-code-pro/releases/tag/2.010R-ro/1.030R-it

@amadeus
Copy link
Author

amadeus commented Jul 18, 2015

@pauldhunt This release works great! Thanks so much! Three years in the making!

@beanaroo
Copy link

beanaroo commented Mar 1, 2016

Not sure if this is worth mentioning, but I too experience the blue line issue displayed by gbitzes in vte terminals and xterm.

Using Sauce Code Pro is a workaround.

@pauldhunt
Copy link
Contributor

@beanaroo which version of the fonts are you using?

@beanaroo
Copy link

beanaroo commented Mar 2, 2016

@pauldhunt I am using the latest release, 2.010R-ro/1.030R-it.
I have noticed other reports of the same behaviour for tmux/zsh/vim plugins but can't be certain which ones are relevant.

@pauldhunt
Copy link
Contributor

@beanaroo can you post some screenshots of how things are displayed in your working environment? That would help me to troubleshoot things. Thanks.

@beanaroo
Copy link

beanaroo commented Mar 2, 2016

Sure thing. In the screenshot below, the two terminals on the left are using the Adobe version and the two terminals on the right are using the powerline patched version, Sauce Code Pro. All other glyphs are a fall back font, ttf-font-awesome. I tested the nerd-fonts version too, but seeing as it leaves Adobe's powerline glyphs untouched, there is no noticable difference.

screen_adobe_powerline

@pauldhunt
Copy link
Contributor

I’ll take another stab at this next time we update the fonts.

@austincrft
Copy link

@beanaroo: This probably isn't the place for this, but I'm super curious. What desktop environment are you using? It looks great.

@beanaroo
Copy link

@austincrft Just for you: 📃 dotfiles
Oh, and I believe it's the font that makes it look so great!

@amadeus amadeus closed this as completed Apr 21, 2016
@JoelOtter
Copy link

JoelOtter commented Jul 28, 2016

Hi all,

Latest version of the fonts (2.030), and my arrows are very slightly vertically misaligned. Hopefully it can be seen in these snippets:


It looks like the arrows are either slightly too large, or placed slightly too high. I don't know a great deal about fonts so I'm not precisely sure what could be causing this issue, but I thought this was probably the best place to start.

These are from tmuxline, but the error happens in vim-airline too, so I think it's the font. I'm using iTerm 3 with all fonts set to SCP 12pt. If I shrink the non-ASCII font to 11pt, they seem to align vertically, but I now see the gap others have described. I'd rather not shrink the font, though, as it breaks block characters in other terminal applications.

Cheers!

@choco
Copy link

choco commented Jul 28, 2016

@JoelOtter You should check out the latest nightly of iTerm, it should fix the vertical alignment issue.

@kenlunde
Copy link

@pauldhunt In case you were not aware, @be5invis submitted L2/19-068 that is a proposal to encode the Powerline symbols, which will be discussed during UTC159 that starts on the last day of this month. If accepted, and once they are included in a version of Unicode, you will be able to change the mappings from PUA code points to non-PUA ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests