kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.28k stars 977 forks source link

Char under the cursor is rendered with thinner font weight #7946

Closed yavorski closed 2 weeks ago

yavorski commented 2 weeks ago

Describe the bug Char under the cursor is rendered with thinner font weight. Especially noticeable when using bold fonts in vim/neovim for example.

To Reproduce

cursor_shape block
cursor_blink_interval 0
cursor_stop_blinking_after 10
shell_integration no-cursor

font_size         11.20
font_family       JetBrains Mono NL Bold
bold_font         JetBrains Mono NL ExtraBold
italic_font       JetBrains Mono NL SemiBold Italic
bold_italic_font  JetBrains Mono NL Bold Italic

Screenshots

See cursor is at @ sign on the screenshot

kitty-thin-cursor

Environment details

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its configuration to the clipboard and paste it here.

kitty 0.36.4 created by Kovid Goyal
Linux arch 6.11.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 04 Oct 2024 21:51:11 +0000 x86_64
Arch Linux 6.11.2-arch1-1 (/dev/tty)

Running under: Wayland (sway version 1.9) missing: blur
OpenGL: '4.6 (Core Profile) Mesa 24.2.4-arch1.1' Detected version: 4.6
Frozen: False
Fonts:
  medium: JetBrainsMonoNL-Bold: /usr/share/fonts/TTF/JetBrainsMonoNL-Bold.ttf:0
          Features: ()
    bold: JetBrainsMonoNL-ExtraBold: /usr/share/fonts/TTF/JetBrainsMonoNL-ExtraBold.ttf:0
          Features: ()
  italic: JetBrainsMonoNL-SemiBoldItalic: /usr/share/fonts/TTF/JetBrainsMonoNL-SemiBoldItalic.ttf:0
          Features: ()
      bi: JetBrainsMonoNL-BoldItalic: /usr/share/fonts/TTF/JetBrainsMonoNL-BoldItalic.ttf:0
          Features: ()
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/bash
Loaded config files:
  /home/user/.config/kitty/kitty.conf

Config options different from defaults:
allow_remote_control       yes
bold_font                  JetBrains Mono NL ExtraBold
bold_italic_font           JetBrains Mono NL Bold Italic
cursor_blink_interval      (0.0, kitty.options.utils.EasingFunction(), kitty.options.utils.EasingFunction())
cursor_stop_blinking_after 10.0
enable_audio_bell          False
font_family                JetBrains Mono NL Bold
font_size                  11.2
hide_window_decorations    1
italic_font                JetBrains Mono NL SemiBold Italic
modify_font:
    cell_height 1
shell_integration          frozenset({'no-cursor'})
window_alert_on_bell       False
Added shortcuts:
    ctrl+alt+1 →  goto_tab 1
    ctrl+alt+2 →  goto_tab 2
    ctrl+alt+3 →  goto_tab 3
    ctrl+alt+4 →  goto_tab 4
    ctrl+alt+5 →  goto_tab 5
    ctrl+alt+6 →  goto_tab 6
    ctrl+alt+7 →  goto_tab 7
    ctrl+alt+8 →  goto_tab 8
    ctrl+alt+9 →  goto_tab 9
Changed shortcuts:
    kitty_mod+j →  previous_tab
    kitty_mod+k →  next_tab
Colors:
    color1                     #f94a4f   
    color10                    #32f891   
    color11                    #f9f655   
    color12                    #41b2f7   
    color13                    #f54bf9   
    color14                    #32f8f4   
    color2                     #32f891   
    color3                     #faf76e   
    color4                     #41b2f7   
    color5                     #f54bf9   
    color6                     #32f8f4   
    color7                     #eaeaea   
    color8                     #444444   
    color9                     #f7191f   
    cursor                     #ff1493   
    foreground                 #eaeaea   
    selection_background       #555555   
    selection_foreground       #eaeaea   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/bin:/usr/bin
    LANG                                en_US.UTF-8
    SHELL                               /bin/bash
    DISPLAY                             :0
    WAYLAND_DISPLAY                     wayland-1
    USER                                user
    XCURSOR_SIZE                        24
    XDG_SEAT                            seat0
    XDG_SESSION_DESKTOP                 sway
    XDG_SESSION_TYPE                    wayland
    XDG_SESSION_CLASS                   user
    XDG_VTNR                            2
    XDG_SESSION_ID                      4
    XDG_RUNTIME_DIR                     /run/user/1000
    LC_TIME                             en_GB.UTF-8
    XDG_DATA_DIRS                       /home/user/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/

On older versions of kitty, run kitty --debug-config instead

✦ 𝝺 [0.048] Shortcut: ctrl+alt+10 has unknown key, ignoring
[0.125] Text fonts:
[0.125]   Normal: JetBrainsMonoNL-Bold: /usr/share/fonts/TTF/JetBrainsMonoNL-Bold.ttf:0
Features: ()
[0.125]   Bold: JetBrainsMonoNL-ExtraBold: /usr/share/fonts/TTF/JetBrainsMonoNL-ExtraBold.ttf:0
Features: ()
[0.125]   Italic: JetBrainsMonoNL-SemiBoldItalic: /usr/share/fonts/TTF/JetBrainsMonoNL-SemiBoldItalic.ttf:
Features: ()
[0.125]   Bold-Italic: JetBrainsMonoNL-BoldItalic: /usr/share/fonts/TTF/JetBrainsMonoNL-BoldItalic.ttf:0
Features: ()
[0.127] [glfw error 65544]: Notify: Failed to get server capabilities error: [org.freedesktop.DBus.Error.S
✦ 𝝺 [0.194] U+1d77a bold Face(family=DejaVu Sans style=Bold ps_name=DejaVuSans-Bold path=/usr/share/fonts/
TTF/DejaVuSans-Bold.ttf ttc_index=0 variant=False named_instance=False scalable=True color=False)
kovidgoyal commented 2 weeks ago

No, it isnt, that's just an optical illusion because in one case you are seeing light on dark and in the other you are seeing dark on light. The gamma blending used for antialiasing causes it. You can mitigate it by choosing a more balanced gamma curve via the text_composition_strategy setting in kitty.conf