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

Symbol nerd font rendering partially broken since 0.32.0 #7081

Closed
oddlama opened this issue Jan 30, 2024 · 3 comments
Closed

Symbol nerd font rendering partially broken since 0.32.0 #7081

oddlama opened this issue Jan 30, 2024 · 3 comments
Labels

Comments

@oddlama
Copy link

oddlama commented Jan 30, 2024

Describe the bug
I've been using JetBrains Mono Nerd fonts on my system in the configuration recommended by the kitty wiki, i.e. using the upstream JetBrains Mono fonts and just the Nerd Font Symbols as a separate font letting kitty pick them up automatically.

After updating to 0.32.0, some Nerd Font symbols are not shown anymore. I've just tested this against the latest commit 9b8ee54 which also doesn't render the fonts correctly (see screenshots below). Executing an older binary of kitty 0.31.0 does show all fonts correctly, so I believe I can rule out problems with my system font configuration.

To Reproduce

Steps to reproduce the behavior:

  1. Install JetBrains Mono
  2. Install Nerd Font Symbol Font
  3. Use JetBrains Mono in Kitty
  4. Run echo -e '\ue725 \ue702 \Uf199f \Uf02a2' and observe output (see screenshots below)

Screenshots

Kitty 0.32.1:

image

Kitty 0.31.0:

image

Environment details

kitty 0.32.1 (broken):

kitty 0.32.1 created by Kovid Goyal
Linux kroma 6.6.14 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:36:01 UTC 2024 x86_64
Tue Jan 30 2024  17:23:20
This is e{cyan}kromae{reset} [e{lightblue}/dev/ttye{reset}] (Linux x86_64 6.6.14)
e{halfbright}4e{reset} e{halfbright}6e{reset}
DISTRIB_CODENAME=uakari
DISTRIB_DESCRIPTION="NixOS 24.05 (Uakari)"
DISTRIB_ID=nixos
DISTRIB_RELEASE="24.05"
LSB_VERSION="24.05 (Uakari)"
Running under: X11
Frozen: False
Paths:
  kitty: /nix/store/bg426521vyw6j61ib2j2f54mlw0mims7-kitty-0.32.1/bin/kitty
  base dir: /nix/store/bg426521vyw6j61ib2j2f54mlw0mims7-kitty-0.32.1/lib/kitty
  extensions dir: /nix/store/bg426521vyw6j61ib2j2f54mlw0mims7-kitty-0.32.1/lib/kitty/kitty
  system shell: /run/current-system/sw/bin/zsh
Loaded config files:
  /home/myuser/.config/kitty/kitty.conf

Config options different from defaults:
bold_myuser                     JetBrains Mono Bold
bold_italic_myuser              JetBrains Mono Bold Italic
close_on_child_death          True
cursor_blink_interval         0.0
disable_ligatures             1
enable_audio_bell             False
myuser_family                   JetBrains Mono
myuser_size                     20.0
italic_myuser                   JetBrains Mono Italic
open_url_with                 ['xdg-open']
scrollback_lines              100000
scrollback_pager              ['nvim', '-u', 'NONE', '-c', 'set nonumber nolist showtabline=0 foldcolumn=0 laststatus=0', '-c', 'autocmd TermOpen * normal G', '-c', 'silent write! /tmp/kitty_scrollback_buffer | te head -c-1 /tmp/kitty_scrollback_buffer; rm /tmp/kitty_scrollback_buffer; cat']
scrollback_pager_history_size 268435456
Added shortcuts:
	shift+page_down →  scroll_page_down
	shift+page_up →  scroll_page_up
Changed shortcuts:
	kitty_mod+, →  change_myuser_size all +2.0
	kitty_mod+. →  change_myuser_size all -2.0
Colors:
	background                    #090a0c   
	color0                        #090a0c   
	color1                        #b2555d   
	color10                       #98c379   
	color11                       #e6c17c   
	color12                       #61afef   
	color13                       #c678dd   
	color14                       #56b6c2   
	color15                       #abb2bf   
	color2                        #81a566   
	color3                        #ccab6e   
	color4                        #5395cc   
	color5                        #9378de   
	color6                        #56b6c2   
	color7                        #979eab   
	color8                        #393e48   
	color9                        #e06c75   
	foreground                    #c9d3e5   
	selection_background          #979eab   
	selection_foreground          #282c34   

Important environment variables seen by the kitty process:
	PATH                                /nix/store/bg426521vyw6j61ib2j2f54mlw0mims7-kitty-0.32.1/bin:/nix/store/p9qxw3j5xy6zkjc9nwryjpap1zjwjcbc-imagemagick-7.1.1-26/bin:/nix/store/69pv6agzxy6mn915cp1q0qvs88ffp4vd-ncurses-6.4-dev/bin:/nix/store/1x8kr7is0wxfmqb6n7cfgwrkfxy101ci-kitty-0.32.1/bin:/run/wrappers/bin:/home/myuser/.nix-profile/bin:/nix/profile/bin:/home/myuser/.local/state/nix/profile/bin:/etc/profiles/per-user/myuser/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/myuser/.config/zsh/plugins/fzf-tab:/home/myuser/.config/zsh/plugins/fast-syntax-highlighting:/home/myuser/.config/zsh/plugins/zsh-autosuggestions:/home/myuser/.config/zsh/plugins/zsh-histdb:/home/myuser/.config/zsh/plugins/zsh-histdb-skim
	LANG                                C.UTF-8
	EDITOR                              nvim
	SHELL                               /run/current-system/sw/bin/zsh
	DISPLAY                             :0
	USER                                myuser
	XCURSOR_SIZE                        32
	XDG_CONFIG_DIRS                     /etc/xdg:/home/myuser/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/myuser/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/myuser/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg
	XDG_SEAT                            seat0
	XDG_SESSION_TYPE                    tty
	XDG_SESSION_CLASS                   user
	XDG_DESKTOP_PORTAL_DIR              /nix/store/g10s9s5r2f4viqd3ic7d5rmxydjbgxv9-xdg-portals/share/xdg-desktop-portal/portals
	XDG_VTNR                            1
	XDG_SESSION_ID                      1
	XDG_RUNTIME_DIR                     /run/user/1000
	XDG_DATA_DIRS                       /home/myuser/.nix-profile/share:/nix/profile/share:/home/myuser/.local/state/nix/profile/share:/etc/profiles/per-user/myuser/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share

kitty 0.31.0 (working):

kitty 0.31.0 created by Kovid Goyal
Linux kroma 6.6.14 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:36:01 UTC 2024 x86_64
Tue Jan 30 2024  17:25:51
This is e{cyan}kromae{reset} [e{lightblue}/dev/ttye{reset}] (Linux x86_64 6.6.14)
e{halfbright}4e{reset} e{halfbright}6e{reset}
DISTRIB_CODENAME=uakari
DISTRIB_DESCRIPTION="NixOS 24.05 (Uakari)"
DISTRIB_ID=nixos
DISTRIB_RELEASE="24.05"
LSB_VERSION="24.05 (Uakari)"
Running under: X11
Frozen: False
Paths:
  kitty: /nix/store/n2m9kq6xcm7kls07byd3j1yv6rn1wq81-kitty-0.31.0/bin/kitty
  base dir: /nix/store/n2m9kq6xcm7kls07byd3j1yv6rn1wq81-kitty-0.31.0/lib/kitty
  extensions dir: /nix/store/n2m9kq6xcm7kls07byd3j1yv6rn1wq81-kitty-0.31.0/lib/kitty/kitty
  system shell: /run/current-system/sw/bin/zsh
Loaded config files:
  /home/myuser/.config/kitty/kitty.conf

Config options different from defaults:
bold_font                     JetBrains Mono Bold
bold_italic_font              JetBrains Mono Bold Italic
close_on_child_death          True
cursor_blink_interval         0.0
disable_ligatures             1
enable_audio_bell             False
font_family                   JetBrains Mono
font_size                     20.0
italic_font                   JetBrains Mono Italic
open_url_with                 ['xdg-open']
scrollback_lines              100000
scrollback_pager              ['nvim', '-u', 'NONE', '-c', 'set nonumber nolist showtabline=0 foldcolumn=0 laststatus=0', '-c', 'autocmd TermOpen * normal G', '-c', 'silent write! /tmp/kitty_scrollback_buffer | te head -c-1 /tmp/kitty_scrollback_buffer; rm /tmp/kitty_scrollback_buffer; cat']
scrollback_pager_history_size 268435456
Added shortcuts:
	shift+page_down →  scroll_page_down
	shift+page_up →  scroll_page_up
Changed shortcuts:
	kitty_mod+, →  change_font_size all +2.0
	kitty_mod+. →  change_font_size all -2.0
Colors:
	background                    #090a0c   
	color0                        #090a0c   
	color1                        #b2555d   
	color10                       #98c379   
	color11                       #e6c17c   
	color12                       #61afef   
	color13                       #c678dd   
	color14                       #56b6c2   
	color15                       #abb2bf   
	color2                        #81a566   
	color3                        #ccab6e   
	color4                        #5395cc   
	color5                        #9378de   
	color6                        #56b6c2   
	color7                        #979eab   
	color8                        #393e48   
	color9                        #e06c75   
	foreground                    #c9d3e5   
	selection_background          #979eab   
	selection_foreground          #282c34   

Important environment variables seen by the kitty process:
	PATH                                /nix/store/n2m9kq6xcm7kls07byd3j1yv6rn1wq81-kitty-0.31.0/bin:/nix/store/wimlq5g8jdqk3i2wk7h31rdxhjyhahv7-imagemagick-7.1.1-21/bin:/nix/store/2kridj093jlhc9x1y5nvn4j35lgigzid-ncurses-6.4-dev/bin:/nix/store/1x8kr7is0wxfmqb6n7cfgwrkfxy101ci-kitty-0.32.0/bin:/nix/store/p9qxw3j5xy6zkjc9nwryjpap1zjwjcbc-imagemagick-7.1.1-26/bin:/nix/store/69pv6agzxy6mn915cp1q0qvs88ffp4vd-ncurses-6.4-dev/bin:/run/wrappers/bin:/home/myuser/.nix-profile/bin:/nix/profile/bin:/home/myuser/.local/state/nix/profile/bin:/etc/profiles/per-user/myuser/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/myuser/.config/zsh/plugins/fzf-tab:/home/myuser/.config/zsh/plugins/fast-syntax-highlighting:/home/myuser/.config/zsh/plugins/zsh-autosuggestions:/home/myuser/.config/zsh/plugins/zsh-histdb:/home/myuser/.config/zsh/plugins/zsh-histdb-skim
	LANG                                C.UTF-8
	EDITOR                              nvim
	SHELL                               /run/current-system/sw/bin/zsh
	DISPLAY                             :0
	USER                                myuser
	XCURSOR_SIZE                        32
	XDG_CONFIG_DIRS                     /etc/xdg:/home/myuser/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/myuser/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/myuser/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg
	XDG_SEAT                            seat0
	XDG_SESSION_TYPE                    tty
	XDG_SESSION_CLASS                   user
	XDG_DESKTOP_PORTAL_DIR              /nix/store/g10s9s5r2f4viqd3ic7d5rmxydjbgxv9-xdg-portals/share/xdg-desktop-portal/portals
	XDG_VTNR                            1
	XDG_SESSION_ID                      1
	XDG_RUNTIME_DIR                     /run/user/1000
	XDG_DATA_DIRS                       /home/myuser/.nix-profile/share:/nix/profile/share:/home/myuser/.local/state/nix/profile/share:/etc/profiles/per-user/myuser/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share

Additional context
Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

@oddlama oddlama added the bug label Jan 30, 2024
@kovidgoyal
Copy link
Owner

You havent added the symbol_map directive from that FAQ entry to your kitty.conf. Do that and you should be fine. It looks like a different fallback font is being picked up, easily confirmed by running kitty with --debug-font-fallback

@oddlama
Copy link
Author

oddlama commented Jan 30, 2024

Just FYI, I've tried --debug-font-fallback before and it gives the exact same output, which is why I assumed it is a bug.

kitty 0.32.1:

[030 19:07:30.183808] Preloaded font faces:
[030 19:07:30.183856] normal face: /nix/store/6v0wji4zlbc4rj8mj5gvksvf4dmzp3qd-home-manager-path/share/fonts/truetype/JetBrainsMono-Regular.ttf:0
[030 19:07:30.183877] bold face: /nix/store/6v0wji4zlbc4rj8mj5gvksvf4dmzp3qd-home-manager-path/share/fonts/truetype/JetBrainsMono[wght].ttf:458752
[030 19:07:30.183895] italic face: /nix/store/i8z9pqy82nw1vr591cm4vmn6pkp42xmg-jetbrains-mono-2.304/share/fonts/truetype/JetBrainsMono-Italic.ttf:0
[030 19:07:30.183913] bi face: /nix/store/i8z9pqy82nw1vr591cm4vmn6pkp42xmg-jetbrains-mono-2.304/share/fonts/truetype/JetBrainsMono-BoldItalic.ttf:0
U+f017 Face(family=Symbols Nerd Font, style=Regular, ps_name=SymbolsNF, path=/nix/store/bhy4mhdwlsndgbi891fsi8nx5vkb09q7-nerdfonts-3.1.1/share/fonts/truetype/NerdFonts/SymbolsNerdFont-Regular.ttf, index=0, is_scalable=True, has_color=False, ascender=1638, descender=-410, height=2048, underline_position=-306, underline_thickness=102, strikethrough_position=530, strikethrough_thickness=102) (new face)

kitty 0.31.0:

[030 19:07:25.267115] Preloaded font faces:
[030 19:07:25.267173] normal face: /nix/store/6v0wji4zlbc4rj8mj5gvksvf4dmzp3qd-home-manager-path/share/fonts/truetype/JetBrainsMono-Regular.ttf:0
[030 19:07:25.267196] bold face: /nix/store/6v0wji4zlbc4rj8mj5gvksvf4dmzp3qd-home-manager-path/share/fonts/truetype/JetBrainsMono[wght].ttf:458752
[030 19:07:25.267217] italic face: /nix/store/i8z9pqy82nw1vr591cm4vmn6pkp42xmg-jetbrains-mono-2.304/share/fonts/truetype/JetBrainsMono-Italic.ttf:0
[030 19:07:25.267237] bi face: /nix/store/i8z9pqy82nw1vr591cm4vmn6pkp42xmg-jetbrains-mono-2.304/share/fonts/truetype/JetBrainsMono-BoldItalic.ttf:0
U+f017 Face(family=Symbols Nerd Font, style=Regular, ps_name=SymbolsNF, path=/nix/store/bhy4mhdwlsndgbi891fsi8nx5vkb09q7-nerdfonts-3.1.1/share/fonts/truetype/NerdFonts/SymbolsNerdFont-Regular.ttf, index=0, is_scalable=True, has_color=False, ascender=1638, descender=-410, height=2048, underline_position=-306, underline_thickness=102, strikethrough_position=530, strikethrough_thickness=102) (new face)

Diffing this will show that it's the same, byte for byte except for timestamps.
Nonetheless, adding the symbol_map fixes it. Thank you.

EDIT: I notice that after adding the symbol map, some symbols are rendered bigger than before when it was autodetected. Is this expected?

image

EDIT 2: Adding just the symbol_map line from the FAQ suddenly causes some fonts to be rendered from a 9x15 font instead of using JetBrains Mono:

U+e712 Face(family=Fixed, style=Regular, ps_name=, path=/nix/store/rp7kjp0w7j4lrhrcb26innhh4nn1rwlx-font-misc-misc-1.1.3/lib/X11/fonts/misc/9x15.pcf.gz, index=0, is_scalable=False, has_color=False, ascender=0, descender=0, height=0, underline_position=0, underline_thickness=0, strikethrough_position=0, strikethrough_thickness=0) (new face)

image

@BigBrotherJu
Copy link

This issue also appears on Mac with 0.32.1 kitty.

In my case, kitty sometimes picks up nerd font icons from CJK fonts installed in my system, instead of symbols only nerd font.

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

No branches or pull requests

3 participants