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

PowerlineSymbols font rendering issue #1225

Closed
fpbouchard opened this issue Dec 11, 2018 · 19 comments
Closed

PowerlineSymbols font rendering issue #1225

fpbouchard opened this issue Dec 11, 2018 · 19 comments

Comments

@fpbouchard
Copy link

rendering issue

When I start a fresh instance of kitty, the symbols are rendered with an underlying "box". Once I resize the fonts, the box disappears. I can also reset the font size and it still renders correctly.

@kovidgoyal
Copy link
Owner

which symbol is this? on what version of kitty on what OS? with what actual font?

@fpbouchard
Copy link
Author

Symbol e0b1, kitty 0.12.3, Mac OS X Mojave, PowerlineSymbols font

@kovidgoyal
Copy link
Owner

First, there have been lots of changes to kitty since 0.12.3 so update
and test. Secondly, you dont need to use powerlinesymbols for that
character, there is a perfectly useable alternative in unicode, see
U+29fd

Finally, if you do want me to take a look at it, please post a link to
where I can download the exact font you are using. There are all sorts
of builds of "PowerlineSymbols" floating around

@fpbouchard
Copy link
Author

  1. My bad on running on an older version, sorry about that. I've updated to 0.13.1, the issue is still there
  2. The U+29fd character is not adequate for my current usage.
  3. I'm using the otf font from the powerline repository: PowerlineSymbols. However, I've also tried it using "patched" fonts that I knew were working before using kitty (I started using the powerline-only fonts since using kitty thanks to its great symbol_map feature) but I get the same issue no matter which font I use.

Here is a clearer screenshot of my use case, in neovim's lightline at the bottom of the screen.

  1. Before changing font size:

screen shot 2018-12-11 at 20 45 06

  1. And after having changed the font size:

screen shot 2018-12-11 at 20 45 22

While comparing both screenshots, I can see that there seems to be an issue with the character width since the alignment of the glyph changes between the two screenshots (only for this character).

Thanks for your time.

@kovidgoyal
Copy link
Owner

I dont see that on my macOS machine -- I'm guessing it only happens at some font sizes. Can you post a minimal kitty.conf to reproduce. Also are you on a retina screen? And does changing the font size back to the original cause the issue to re-appear?

@kovidgoyal
Copy link
Owner

no followup

@fpbouchard
Copy link
Author

@kovidgoyal

Ok, I had some time to test this. I just reinstalled kitty from scratch, the PowerlineFonts from scratch, on both my MBPs. Fresh kitty.conf, the only change I make is that I uncomment the following line:
symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols

When I type the U+E0B1 symbol, it appears like my first screenshot on both MBPs. Both have retina displays.

Using the latest version (0.13.3), zooming in/out doesn't fix the issue anymore. When it did, the rendering was fixed even when going back to the original font size.

@kovidgoyal
Copy link
Owner

Are you sure you are actually loading the correct font? run kitty with --debug-font-fallback to check

@kovidgoyal
Copy link
Owner

I tried again with:

kitty --config NONE -o "symbol_map=U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols" --debug-font-fallback zsh -c "printf '\ue0b1'; read"

and I cannot reproduce.

@fpbouchard
Copy link
Author

fpbouchard commented Mar 5, 2019

Weird. It does work when I run your snippet, even with my full config, but not when I run an interactive shell (standard bash).

Might be something in my rc files? An environment variable?

[064 08:59:00.880332] Preloaded font faces:
[064 08:59:00.880370] normal face: {'monospace': True, 'bold': False, 'italic': False, 'family': 'Menlo'}
[064 08:59:00.880387] bold face: {'monospace': True, 'bold': True, 'italic': False, 'family': 'Menlo'}
[064 08:59:00.880402] italic face: {'monospace': True, 'bold': False, 'italic': True, 'family': 'Menlo'}
[064 08:59:00.880416] bi face: {'monospace': True, 'bold': True, 'italic': True, 'family': 'Menlo'}
[064 08:59:00.880432] Symbol map faces:
[064 08:59:00.880453] {'path': '/Users/fpbouchard/Library/Fonts/PowerlineSymbols.otf', 'postscript_name': 'PowerlineSymbols', 'family': 'PowerlineSymbols', 'style': 'Medium', 'bold': False, 'italic': False, 'monospace': True, 'weight': 0.23000000417232513, 'width': 0.0, 'traits': 1024}

@fpbouchard
Copy link
Author

I can also reproduce if I start neovim like this and type the unicode character (i,ctrl+v,u,e0b1):

kitty --config NONE -o "symbol_map=U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols" --debug-font-fallback nvim

@fpbouchard
Copy link
Author

fpbouchard commented Mar 5, 2019

Log:

fp-macbook:~ fpbouchard$ kitty --config NONE -o "symbol_map=U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols" --debug-font-fallback nvim
[064 09:11:37.497958] Preloaded font faces:
[064 09:11:37.497995] normal face: {'monospace': True, 'bold': False, 'italic': False, 'family': 'Menlo'}
[064 09:11:37.498012] bold face: {'monospace': True, 'bold': True, 'italic': False, 'family': 'Menlo'}
[064 09:11:37.498026] italic face: {'monospace': True, 'bold': False, 'italic': True, 'family': 'Menlo'}
[064 09:11:37.498040] bi face: {'monospace': True, 'bold': True, 'italic': True, 'family': 'Menlo'}
[064 09:11:37.498055] Symbol map faces:
[064 09:11:37.498074] {'path': '/Users/fpbouchard/Library/Fonts/PowerlineSymbols.otf', 'postscript_name': 'PowerlineSymbols', 'family': 'PowerlineSymbols', 'style': 'Medium', 'bold': False, 'italic': False, 'monospace': True, 'weight': 0.23000000417232513, 'width': 0.0, 'traits': 1024}
[064 09:11:37.815928] Escape codes to resize text area are not supported
[064 09:11:40.571966] WARNING: Your system's OpenGL implementation does not have glCopyImageSubData, falling back to a slower implementation

@kovidgoyal
Copy link
Owner

Cannot reproduce with neovim either with that command line

@matclab
Copy link

matclab commented Apr 24, 2019

Same problem as @fpbouchard here. The zsh print snippet works, but in vim or neovim, I got a spurious little box after the angle symbol.
I'm on arch linux with kitty 0.13.3.

However, the following (with a space after e0b1) shows the problem:

kitty --config NONE -o "symbol_map=U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols" --debug-font-fallback zsh -c "printf '\ue0b1 '; read"

Capture d’écran de 2019-04-24 09-28-13

@hillyu
Copy link

hillyu commented May 6, 2019

same here on linux.

@RobSis
Copy link

RobSis commented Jul 11, 2019

Since we now have clear steps to reproduce the issue, can this PR be re-opened?

@kovidgoyal kovidgoyal reopened this Jul 11, 2019
@Luflosi
Copy link
Contributor

Luflosi commented Jul 11, 2019

I can reproduce the weird character with the PowerlineSymbols font linked above:
PowerlineSymbols
However, the issue goes away when I use 3270Medium Nerd Font Mono (from https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/3270/Medium/complete/3270-Medium%20Nerd%20Font%20Complete%20Mono.otf I think):
3270Medium Nerd Font Mono

@matclab
Copy link

matclab commented Sep 15, 2019

Thank a lot !

@fpbouchard
Copy link
Author

Thanks!

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

No branches or pull requests

6 participants