kovidgoyal / kitty

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

Font rendering is off #7000

Closed AnotherRandomGitHubAccount closed 8 months ago

AnotherRandomGitHubAccount commented 8 months ago

Describe the bug Text rendering looks off in kitty, especially as highlighted text looks extra thin. here's an image of my issue: thing Alacritty is on the left, kitty is on the right. they are both set to font FiraCode Nerd Font (size = 15.0). As you can see, the font rendering looks worse on kitty. (if you can't see it, view the image with no scaling)

To Reproduce Run kitty under the nixOS tapir release, for more accurate results try wayland, and for the most try Hyprland. I'm not sure if thats where the issue is.

Environment details

kitty 0.31.0 created by Kovid Goyal
Linux laptop 6.1.67 #1-NixOS SMP PREEMPT_DYNAMIC Mon Dec 11 09:41:01 UTC 2023 x86_64

<<< Welcome to NixOS 23.11.20231212.cf28ee2 (x86_64) - /dev/tty >>>

Run 'nixos-help' for the NixOS manual.

DISTRIB_CODENAME=tapir
DISTRIB_DESCRIPTION="NixOS 23.11 (Tapir)"
DISTRIB_ID=nixos
DISTRIB_RELEASE="23.11"
LSB_VERSION="23.11 (Tapir)"
Running under: Wayland
Frozen: False
Paths:
  kitty: /nix/store/ds307nimna5jamf9prkkl7ji7czcj9zf-kitty-0.31.0/bin/kitty
  base dir: /nix/store/ds307nimna5jamf9prkkl7ji7czcj9zf-kitty-0.31.0/lib/kitty
  extensions dir: /nix/store/ds307nimna5jamf9prkkl7ji7czcj9zf-kitty-0.31.0/lib/kitty/kitty
  system shell: /run/current-system/sw/bin/bash
Loaded config files:
  /home/bongo/.config/kitty/kitty.conf

Config options different from defaults:
font_family             FiraCode Nerd Font
font_size               15.0
Colors:
    active_border_color     #f8f8f2   
    active_tab_background   #272822   
    active_tab_foreground   #f8f8f2   
    background              #272822   
    color0                  #272822   
    color1                  #f92672   
    color10                 #383830   
    color11                 #49483e   
    color12                 #a59f85   
    color13                 #f5f4f1   
    color14                 #cc6633   
    color15                 #f9f8f5   
    color2                  #a6e22e   
    color3                  #f4bf75   
    color4                  #66d9ef   
    color5                  #ae81ff   
    color6                  #a1efe4   
    color7                  #f8f8f2   
    color8                  #75715e   
    color9                  #fd971f   
    cursor                  #f8f8f2   
    foreground              #f8f8f2   
    inactive_border_color   #383830   
    inactive_tab_background #383830   
    inactive_tab_foreground #a59f85   
    selection_background    #f8f8f2   
    selection_foreground    #272822   
    tab_bar_background      #383830   
    url_color               #a59f85   

Important environment variables seen by the kitty process:
    PATH                                /nix/store/ds307nimna5jamf9prkkl7ji7czcj9zf-kitty-0.31.0/bin:/nix/store/4rh0ynvm4vl28gh0yg8ni68v64mr1ddm-imagemagick-7.1.1-21/bin:/nix/store/hd191cw5fi2k194gg5kjqh7q47k44pq7-ncurses-6.4-dev/bin:/run/wrappers/bin:/home/bongo/.nix-profile/bin:/nix/profile/bin:/home/bongo/.local/state/nix/profile/bin:/etc/profiles/per-user/bongo/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/nix/store/lwqnazddv8037sin49482dnzc9iwgg8l-binutils-wrapper-2.40/bin:/nix/store/s4py1x222394achh9n8dvk01wknmg2hn-pciutils-3.10.0/bin
    LANG                                en_US.UTF-8
    EDITOR                              nano
    SHELL                               /run/current-system/sw/bin/bash
    DISPLAY                             :1
    WAYLAND_DISPLAY                     wayland-1
    USER                                bongo
    XCURSOR_SIZE                        24
    XDG_CONFIG_DIRS                     /etc/xdg:/home/bongo/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/bongo/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/bongo/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg
    XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session0
    XDG_BACKEND                         wayland
    XDG_SEAT                            seat0
    XDG_SESSION_DESKTOP                 hyprland
    XDG_SESSION_TYPE                    wayland
    XDG_GREETER_DATA_DIR                /var/lib/lightdm-data/bongo
    XDG_CURRENT_DESKTOP                 Hyprland
    XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
    XDG_SESSION_CLASS                   user
    XDG_DESKTOP_PORTAL_DIR              /nix/store/ycfdjp98w63k7rl6dcnypmvznlam7kp5-xdg-portals/share/xdg-desktop-portal/portals
    XDG_VTNR                            8
    XDG_SESSION_ID                      2
    XDG_RUNTIME_DIR                     /run/user/1000
    XDG_DATA_DIRS                       /nix/store/r9mzia8cq8f54d4wvixd1izw6ymfs657-desktops/share:/home/bongo/.nix-profile/share:/nix/profile/share:/home/bongo/.local/state/nix/profile/share:/etc/profiles/per-user/bongo/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share

Additional context With kitty --config NONE, it obviously uses a different monospace font but the rendering issue is still there.

kovidgoyal commented 8 months ago

I agree the font rendering in alacritty looks off to me too. Thankfully, kitty provides a knob you can adjust to get the rendering you like: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.text_composition_strategy