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

Firacode Rendering on OSX for ligatures looks offset and not-centered. #2591

Closed
EvanCarroll opened this issue Apr 26, 2020 · 9 comments
Closed

Comments

@EvanCarroll
Copy link

EvanCarroll commented Apr 26, 2020

This looks really weird compared to my Debian machine,

Screen Shot 2020-04-25 at 22 36 16

On my Debian machine, HELLO::WORLD results in the :: being tighter together without sitting on the left with a glaring space on the right.

I'm using FiraCode Nerd Font and I've tried with FiraCode Nerd Font Retina


$ kitty --version
kitty 0.17.3 created by Kovid Goyal

[116 22:39:19.097078] Preloaded font faces:
[116 22:39:19.097111] normal face: /Users/evancarroll/Library/Fonts/Fira Code Retina Nerd Font Complete.otf
[116 22:39:19.097124] bold face: /Users/evancarroll/Library/Fonts/Fira Code Retina Nerd Font Complete.otf
[116 22:39:19.097135] italic face: /Users/evancarroll/Library/Fonts/Fira Code Retina Nerd Font Complete.otf
[116 22:39:19.097145] bi face: /Users/evancarroll/Library/Fonts/Fira Code Retina Nerd Font Complete.otf

$ brew cask info font-firacode-nerd-font
font-firacode-nerd-font: 2.1.0
https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode
/usr/local/Caskroom/font-firacode-nerd-font/2.1.0 (80 files, 140.5MB)
From: https://github.com/Homebrew/homebrew-cask-fonts/blob/master/Casks/font-firacode-nerd-font.rb
==> Name
FiraCode Nerd Font (Fira Code)
==> Artifacts
Fira Code Light Nerd Font Complete Mono.otf (Font)
Fira Code Medium Nerd Font Complete.otf (Font)
Fira Code Retina Nerd Font Complete.otf (Font)
Fira Code Regular Nerd Font Complete.otf (Font)
Fira Code Light Nerd Font Complete.otf (Font)
Fira Code Bold Nerd Font Complete Mono.otf (Font)
Fira Code Medium Nerd Font Complete Mono.otf (Font)
Fira Code Retina Nerd Font Complete Mono.otf (Font)
Fira Code Regular Nerd Font Complete Mono.otf (Font)
Fira Code Bold Nerd Font Complete.otf (Font)
@kovidgoyal
Copy link
Owner

First, dont use patched fonts. They are often broken. And there is no need to use them with kitty. As long as you have the nerd fonts installed, kitty will pick up and use them automatically, or you could configure it to do so with symbol_map in kitty.conf. let me know if the issue persists without using patched fonts, if so, I will take a look.

@EvanCarroll
Copy link
Author

EvanCarroll commented Apr 26, 2020

@kovidgoyal I tried the unpatched fonts; I believe these fonts are now unpatched (same effect). I had started with them:

[116 23:30:11.822716] Preloaded font faces:
[116 23:30:11.822748] normal face: /Users/evancarroll/Library/Fonts/FiraCode-Retina.otf
[116 23:30:11.822761] bold face: /Users/evancarroll/Library/Fonts/FiraCode-Retina.otf
[116 23:30:11.822771] italic face: /Users/evancarroll/Library/Fonts/FiraCode-Retina.otf
[116 23:30:11.822781] bi face: /Users/evancarroll/Library/Fonts/FiraCode-Retina.otf

$ brew search fira
==> Casks
font-fira-code ✔                         font-fira-sans
font-fira-mono                           font-firacode-nerd-font
font-fira-mono-for-powerline             font-firamono-nerd-font

$ brew cask info font-fira-code
font-fira-code: 3.1
https://github.com/tonsky/FiraCode
/usr/local/Caskroom/font-fira-code/3.1 (29 files, 3.8MB)
From: https://github.com/Homebrew/homebrew-cask-fonts/blob/master/Casks/font-fira-code.rb
==> Name
Fira Code
==> Artifacts
otf/FiraCode-Bold.otf (Font)
otf/FiraCode-Light.otf (Font)
otf/FiraCode-Medium.otf (Font)
otf/FiraCode-Regular.otf (Font)
otf/FiraCode-Retina.otf (Font)

@kovidgoyal kovidgoyal reopened this Apr 26, 2020
@alappe
Copy link

alappe commented Apr 27, 2020

I can confirm this issue. It was introduced with v0.17.3 and working fine with v0.17.2.

Using kitty on macOS 10.14, Fira Code Retina, v3.1

@kovidgoyal
Copy link
Owner

Then it will be because of the fix for #1457

I dont really see a good solution here. centering breaks rendering for
some glyphs and not centering breaks rendering for others and there is
no a-priori way to know which are which. I could implement some hacky
solution like tracking if the glyph is a ligature and centering in that
case on macOS.

@kovidgoyal
Copy link
Owner

Note, I have not tested the fix, I leave that to somebody that uses macOS as their primary platform.

@alappe
Copy link

alappe commented Apr 27, 2020

Using make app in the master including your fix, I still have issues:

Screenshot 2020-04-27 at 13 55 55

kovidgoyal added a commit that referenced this issue Apr 27, 2020
This is needed for FiraCode ligatures to line up correctly. See
#2591 (comment)
@kovidgoyal
Copy link
Owner

This should fix that: e803505

@alappe
Copy link

alappe commented Apr 27, 2020

Yes it does, thank you!

@horta
Copy link
Contributor

horta commented May 6, 2020

Great work!

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

4 participants