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

Alignment bug with some of the fonts. #31

Open
trusktr opened this Issue Apr 23, 2013 · 12 comments

Comments

Projects
None yet
10 participants
@trusktr

trusktr commented Apr 23, 2013

The left triangles (the dividers between the sections on the left end of powerline) are not lining up properly.

Screenshot: http://50.116.4.56/~/img/powerline-ubuntu-misaligned.png

Right after the yellow NORMAL section, the triangle that points rightward doesn't line up fully. The left vertical edge of the triangle seems slightly smaller than the height of the line, creating two kinks on top and bottom.

Simmilarly, with the incosolata font, the triangles are taller than the line.

Screenshot: http://50.116.4.56/~/img/powerline-inconsolata-misaligned.png

The Ubuntu misalignment happens in both console vim and gvim, while the inconsolata misalignment happens only in console vim (looks perfect in gvim).

EDIT: Ubuntu Mono size 13 is horrible: http://50.116.4.56/~/img/powerline-ubuntu13-misaligned.png

@hanjianwei

This comment has been minimized.

Show comment
Hide comment
@hanjianwei

hanjianwei Apr 27, 2013

I have the same issue on iTerm2@OSX (though I can not see your images). Only Liberation Mono works well here. I have to change the vertical spacing between characters.

hanjianwei commented Apr 27, 2013

I have the same issue on iTerm2@OSX (though I can not see your images). Only Liberation Mono works well here. I have to change the vertical spacing between characters.

@trusktr

This comment has been minimized.

Show comment
Hide comment
@trusktr

trusktr Apr 27, 2013

Yeah, it seems like the special characters tend to be bigger or smaller than the height of all other characters, and it's inconsistent when you change font size.

trusktr commented Apr 27, 2013

Yeah, it seems like the special characters tend to be bigger or smaller than the height of all other characters, and it's inconsistent when you change font size.

@tylorr

This comment has been minimized.

Show comment
Hide comment
@tylorr

tylorr Jan 25, 2014

Is there any fix for this? I am having the same issue with the Anonymice font on Windows 7 and gVim.

tylorr commented Jan 25, 2014

Is there any fix for this? I am having the same issue with the Anonymice font on Windows 7 and gVim.

@Lokaltog

This comment has been minimized.

Show comment
Hide comment
@Lokaltog

Lokaltog Jan 25, 2014

Member

Currently no. There's just too many factors (different ways of calculating font metrics, different operating systems, different antialiasing technologies, different fonts) to reliably patch a font for every single combination of these factors. You can patch it manually in fontforge or ignore the issue until a fix is found.

Member

Lokaltog commented Jan 25, 2014

Currently no. There's just too many factors (different ways of calculating font metrics, different operating systems, different antialiasing technologies, different fonts) to reliably patch a font for every single combination of these factors. You can patch it manually in fontforge or ignore the issue until a fix is found.

@mt-digital

This comment has been minimized.

Show comment
Hide comment
@mt-digital

mt-digital Feb 8, 2014

After trying powerline on terminal vim and zsh on Ubuntu and OS X, I have found the most consistent good performance is to use the Droid Mono for Powerline for both the ASCII and non-ASCII fonts in iTerm2 on OS X (both with terminal vim and using the zsh agnoster theme).

I've found that I can set both the ASCII and non-ASCII to 18 and everything lines up perfectly. With other fonts I've found that if I mix the non-ASCII from a different font then everything lines up well. Or, the alignment is good when I just subtract up to one pixel from the non-ascii font.

mt-digital commented Feb 8, 2014

After trying powerline on terminal vim and zsh on Ubuntu and OS X, I have found the most consistent good performance is to use the Droid Mono for Powerline for both the ASCII and non-ASCII fonts in iTerm2 on OS X (both with terminal vim and using the zsh agnoster theme).

I've found that I can set both the ASCII and non-ASCII to 18 and everything lines up perfectly. With other fonts I've found that if I mix the non-ASCII from a different font then everything lines up well. Or, the alignment is good when I just subtract up to one pixel from the non-ascii font.

@gpakosz

This comment has been minimized.

Show comment
Hide comment
@gpakosz

gpakosz Feb 8, 2014

@Lokaltog I've always downloaded pre-patched fonts. When you say "patch it manually", do you mean just running the patching scripts locally? Or open up FontForge and tweak alignment in there?

gpakosz commented Feb 8, 2014

@Lokaltog I've always downloaded pre-patched fonts. When you say "patch it manually", do you mean just running the patching scripts locally? Or open up FontForge and tweak alignment in there?

@oconnor663

This comment has been minimized.

Show comment
Hide comment
@oconnor663

oconnor663 Aug 1, 2015

I've tried a number of combinations, and I haven't been able to find any that line the arrows up properly in Ubuntu Mono. Here are two attempts from Arch:

I've created clean Ubuntu, Debian, Fedora, and OpenSUSE VMs just to see if it's something with my local config. They're all off. Is this expected? Is it possible I'm consistently forgetting some step in the install instructions, or does the fact that I'm seeing the glyphs at all mean that I did all the steps? How did all the screenshots I see on the internet manage to get their perfect alignment?! >.<

oconnor663 commented Aug 1, 2015

I've tried a number of combinations, and I haven't been able to find any that line the arrows up properly in Ubuntu Mono. Here are two attempts from Arch:

I've created clean Ubuntu, Debian, Fedora, and OpenSUSE VMs just to see if it's something with my local config. They're all off. Is this expected? Is it possible I'm consistently forgetting some step in the install instructions, or does the fact that I'm seeing the glyphs at all mean that I did all the steps? How did all the screenshots I see on the internet manage to get their perfect alignment?! >.<

oconnor663 added a commit to oconnor663/powerline-fontpatcher that referenced this issue Aug 2, 2015

metric changes to make gnome-terminal look good
The powerline glyphs don't seem to render properly in gnome-terminal
under any distro. I'm not sure why. I posted questions that might get
answered in the future:

- https://groups.google.com/forum/#!topic/powerline-support/mTIsGWW34U0
- powerline/fonts#31 (comment)

In the meantime, these changes seem to make the glyphs render better.
Note that I'm testing this in gnome-terminal on Arch with the
ubuntu-patched freetype2/fontconfig/cairo libraries. I can already tell
that e.g. Konsole renders things differently.

Here's the command to generate a TTF file (which goes in ~/.fonts):

fontforge -lang ff -c 'Open($1); Generate($2)' powerline-symbols.sfd powerline-symbols.ttf
@oconnor663

This comment has been minimized.

Show comment
Hide comment
@oconnor663

oconnor663 Aug 2, 2015

I've been playing with this in FontForge, and these seem to be the tweaks that make things look good in gnome-terminal: oconnor663/powerline-fontpatcher@d2c66ea

This is my first time editing a font, so I have no idea what I'm doing. Here's what it comes out looking like (Arch Linux, gnome-terminal, Ubuntu Mono 15, gnome-tweak-tool set to "light" font hinting, ubuntu-patched font rendering libraries):

image

oconnor663 commented Aug 2, 2015

I've been playing with this in FontForge, and these seem to be the tweaks that make things look good in gnome-terminal: oconnor663/powerline-fontpatcher@d2c66ea

This is my first time editing a font, so I have no idea what I'm doing. Here's what it comes out looking like (Arch Linux, gnome-terminal, Ubuntu Mono 15, gnome-tweak-tool set to "light" font hinting, ubuntu-patched font rendering libraries):

image

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 14, 2016

Same issue here, tried with roboto, monospace, etc.

ghost commented Feb 14, 2016

Same issue here, tried with roboto, monospace, etc.

@m-sameer

This comment has been minimized.

Show comment
Hide comment
@m-sameer

m-sameer Jan 9, 2018

@oconnor663 Thanks, man, it helped me a lot. My Vim was so ugly to look at, and now, it looks like heaven. Thanks a lot. :)

m-sameer commented Jan 9, 2018

@oconnor663 Thanks, man, it helped me a lot. My Vim was so ugly to look at, and now, it looks like heaven. Thanks a lot. :)

@Who23

This comment has been minimized.

Show comment
Hide comment
@Who23

Who23 Aug 21, 2018

I know that this thread is a bit old, but for anybody reading who doesn't want to patch a font by themselves, I found a simpler solution, in the native Terminal app. You have to change the line spacing in the font settings, and you can get the glyphs to match up with the size of the text.

Hope this helps

Who23 commented Aug 21, 2018

I know that this thread is a bit old, but for anybody reading who doesn't want to patch a font by themselves, I found a simpler solution, in the native Terminal app. You have to change the line spacing in the font settings, and you can get the glyphs to match up with the size of the text.

Hope this helps

@ohcibi

This comment has been minimized.

Show comment
Hide comment
@ohcibi

ohcibi Aug 22, 2018

I can confirm @Who23 solution plus I played with it a bit and found that the issue seems to be that the font height is not changed for the special characters when the vertical character spacing gets change. i.e. on 100% which is the default it seems to be off for iterm2. Decreasing the value increases the effect like shown in @oconnor663's first image (special powerline glyphs appear to small) whereas increasing the line spacing increases the effect of the second image (special powerline glyphs appear to big). For me setting it to 110% works but I guess it depends on the font family and the size used.

ohcibi commented Aug 22, 2018

I can confirm @Who23 solution plus I played with it a bit and found that the issue seems to be that the font height is not changed for the special characters when the vertical character spacing gets change. i.e. on 100% which is the default it seems to be off for iterm2. Decreasing the value increases the effect like shown in @oconnor663's first image (special powerline glyphs appear to small) whereas increasing the line spacing increases the effect of the second image (special powerline glyphs appear to big). For me setting it to 110% works but I guess it depends on the font family and the size used.

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