zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.59k stars 2.64k forks source link

Zed on Gnome should support font scaling factor org.gnome.desktop.interface text-scaling-factor #14971

Open ascarter opened 1 month ago

ascarter commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

4K support for Gnome is complicated. I use 100% as my integer scaling factor and then use Gnome tweaks to scale text up. This seems to work much better than fractional scaling. Most apps I'm using respond correctly to the text scaling. Zed however does not. I can manually adjust the UI and buffer font sizes but the menus for example are still not the right size. In general, it would be ideal for Zed to support text-scaling-factor. VS Code supports it and looks great using it. The Gnome UI seems to adjust fine around using larger text so it's a good way to use the 4k screen for more density and keep the text readable.

% gsettings get org.gnome.desktop.interface text-scaling-factor 
1.5

Environment

OS: Fedora Linux 40 (Workstation Edition) x86_64 
Host: X570 AORUS MASTER -CF 
Kernel: 6.9.9-200.fc40.x86_64 
Uptime: 3 days, 2 hours, 32 mins 
Packages: 2323 (rpm), 19 (flatpak) 
Shell: zsh 5.9 
Resolution: 3840x2160 
DE: GNOME 46.3.1 
WM: Mutter 
WM Theme: Adwaita 
Theme: Adwaita [GTK2/3] 
Icons: Adwaita [GTK2/3] 
Terminal: gnome-terminal 
CPU: AMD Ryzen 9 3900XT (24) @ 3.800GHz 
GPU: NVIDIA RTX A4000 
Memory: 8972MiB / 128718MiB 

Zed:

% zed --version
Zed 0.144.4 – /home/andrew/.local/zed.app/libexec/zed-editor

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


bbb651 commented 1 month ago

Should be pretty easy to get the value as it's exposed in the settings portals and other keys are used already, I think it can be done here https://github.com/zed-industries/zed/blob/38e3182bef48a9aec70fbba1b789b59e5098d4d2/crates/gpui/src/window.rs#L2430