NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

fira-code package doesn't play nice with kitty font_features setting #292489

Open rohrsben opened 6 months ago

rohrsben commented 6 months ago

Describe the bug

Impossible to enable stylistic sets in Fira Code using kitty's font_features setting, when using the nixpkgs#fira-code package.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install both nixpkgs#kitty and nixpkgs#fira-code, through either nixos or home-manager
  2. In .config/kitty/kitty.conf, add the line "font_family FiraCodeRoman_400wght
  3. In new kitty window, type "0"
  4. In kitty.conf, append the line "font_features FiraCodeRoman_400wght +zero"
  5. in new kitty window, type "0" again

Expected behavior

Zero character would switch from zero with a slash through it to zero with a dot (or more generally, any of the stylistic sets work at all)

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

As far as I can tell the problem is that nixpkgs#fira-code installs only the variable weight font. I tested this by removing the fira-code package entirely, downloading the same zip that the package downloads, and then copying the resultant "ttf/FiraCode-Regular.ttf" into .local/share/fonts (and running fc-cache).

After resetting my kitty.conf ("font_family FiraCode-Regular" and "font_features FiraCode-Regular +zero") expected behaviour resumes and I can use stylistic sets again. I then followed the same process, but this time copying the variable weight to .local/share/fonts, and the issue resumed.

I don't know enough to contribute a merge to fix this, otherwise I would do more than just filing a report. Sorry!

Notify maintainers

@rycee the person who made the change, just in case they know something extra: @midchildan

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.6-zen1, NixOS, 24.05 (Uakari), 24.05.20240228.9099616`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/nix/store/cbbsvzjcqvzlylq9s7p6d2gyxh64q88p-source`

Add a :+1: reaction to issues you find important.

midchildan commented 6 months ago

I don't have a Linux DE handy at the moment, but I can successfully enable stylistic sets for the variable Fira Code on my Mac. So the font itself seems fine.

firacode