kovidgoyal / kitty

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

Font size ignoring Xft.dpi in ~/.Xresources #3464

Closed starcraft66 closed 3 years ago

starcraft66 commented 3 years ago

Describe the bug When I open kitty, the text is rendered with a font size that is way too small and totally disregards the scaling factor of 1.5 applied on my system. Numerous closed issues I've looked at regarding HiDPI font sizes were closed telling the reporter to set Xft.dpi in ~/.Xresources. This is already the case on my system, I have Xft.dpi: 144 which pretty much every other application on the system respects. I've attached a screenshot showing Alacritty and Kitty side-by-side. Both are using a font size of 12. Alacritty properly multiplies the 12 by a factor of 1.5 but Kitty applies no scaling factor.

To Reproduce Steps to reproduce the behavior:

  1. Set Xft.dpi: 144
  2. Set Kitty font size to 12
  3. Open Kitty

Expected behavior I expect the text rendering to be larger and crisper than normal (HiDPI)

Screenshots Alacritty on the left, Kitty on the right. Both with the font size set to 12

image

Environment details Distributor ID: NixOS Description: NixOS 21.05 (Okapi) Release: 21.05.20210408.a5f6343 Codename: okapi

kitty 0.19.3 created by Kovid Goyal
Linux luna 5.11.11 #1-NixOS SMP Tue Mar 30 12:30:31 UTC 2021 x86_64
<<< Welcome to NixOS 21.05.20210408.a5f6343 (\m) - \l >>>

Run 'nixos-help' for the NixOS manual.
Loaded config files: /home/tristan/.config/kitty/kitty.conf
Running under: X11

Config options different from defaults:
active_border_color        Color(red=204, green=102, blue=102)
active_tab_background      Color(red=138, green=190, blue=183)
active_tab_foreground      Color(red=255, green=255, blue=255)
background                 Color(red=29, green=31, blue=33)
color0                     Color(red=29, green=31, blue=33)
color1                     Color(red=40, green=42, blue=46)
color10                    Color(red=240, green=198, blue=116)
color11                    Color(red=181, green=189, blue=104)
color12                    Color(red=138, green=190, blue=183)
color13                    Color(red=129, green=162, blue=190)
color14                    Color(red=178, green=148, blue=187)
color15                    Color(red=163, green=104, blue=90)
color2                     Color(red=55, green=59, blue=65)
color3                     Color(red=150, green=152, blue=150)
color4                     Color(red=180, green=183, blue=180)
color5                     Color(red=197, green=200, blue=198)
color6                     Color(red=224, green=224, blue=224)
color7                     Color(red=255, green=255, blue=255)
color8                     Color(red=204, green=102, blue=102)
color9                     Color(red=222, green=147, blue=95)
cursor                     Color(red=40, green=42, blue=46)
cursor_blink_interval      1.0
cursor_stop_blinking_after 1.0
cursor_text_color          None
enable_audio_bell          False
enabled_layouts            ['vertical']
font_family                MesloLGS Nerd Font Mono
font_size                  12.0
foreground                 Color(red=255, green=255, blue=255)
inactive_border_color      Color(red=240, green=198, blue=116)
inactive_tab_background    Color(red=204, green=102, blue=102)
inactive_tab_foreground    Color(red=255, green=255, blue=255)
open_url_with              ['xdg-open']
scrollback_lines           10000
selection_background       Color(red=255, green=255, blue=255)
selection_foreground       Color(red=29, green=31, blue=33)
tab_bar_background         Color(red=240, green=198, blue=116)
url_color                  Color(red=138, green=190, blue=183)
kovidgoyal commented 3 years ago

I cannot replicate. Make sure

xrdb -query Xft.dpi

returns the appropriate value. Putting it in Xresources is meaningless unless you actually merge it into xrdb.

starcraft66 commented 3 years ago

My Xresources is definitely merged into xrdb. Here's the output of the command you posted on my machine:

@luna:~ ❯ xrdb -query Xft.dpi
Xcursor.size:   48
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.autohint:   0
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.lcdfilter:  lcddefault
Xft.rgba:   rgb
xft.dpi:    144

I don't think this issue should be closed.

kovidgoyal commented 3 years ago

look at the output you posted. xft.dpi has the wrong case.

starcraft66 commented 3 years ago

Thanks for pointing it out, I missed it. Everything is working as expected now with the correct case!