High DPI issue: 96 DPI is too small, 128 DPI is too big, 112 DPI is perfect, but Chromium and Electron programs don't support it
Hello!
I have a small 1080p monitor. I'm using the KDE System Settings interface to change the "Fonts DPI" value as suggested by the ArchWiki.
The default DPI setting (96 DPI) is a bit too small: I struggle at reading text. 128 DPI is a bit too large: everything becomes way too big and too few windows fit into my monitor.
112 DPI is a perfect value I could find after a bit of experimenting.
KDE and GTK applications supports all the three DPI settings and I'm most comfortable at 112.
Chromium at 112 DPI behaves exactly like at 96 DPI. It shows larger content at 128 DPI, so DPI scaling works, but not fully. I could verify the issue by taking screenshots and comparing them.
This problem also affects Electron programs, and I rely on one heavily.
Is this a known issue? Is it possible to fix it?
About this post
- Posted
- Archived
- Score
- 25 · 100% up
- Kind
- Text
- ID
- fcagfi
13 comments
yep. Any chrome based app can be scaled with
--force-device-scale-factor=1.3example from my PC for 2560x1440 monitorIt seems like it's working. Using
--force-device-scale-factor=1.16gives me what I want. Thank you.It's very weird though. It looks like Chrome based applications support
Xft.dpitoo, just like the GTK applications do, but only for 96 DPI (scale factor 1) and for 128 DPI (scale factor 1.333). Nothing in between. While with--force-device-scale-factorit's possible to use values in between too.
Would you know whether it's possible to set the scale factor value in an environment variable or configuration file? Having to add it to the command line of every Chrome-based application one by one sounds stupid.
i dont know a way to set that globally but
for google-chrome you can create a file at
~/.config/chrome-flags.confand add it theresame for chromium but different name
~/.config/chromium-flags.conffor other electron apps change the .desktop file at /usr/share/applications/
change the line Exec=/usr/bin/SOME-ELECTRON-APP --force-device-scale-factor=1.16 %U
but be aware the .desktop files will be overwritten if you update the app from your distro you need to set it again or write a script that modifies those files so you dont do it manually every time
Also take a look to https://wiki.archlinux.org/index.php/HiDPI a lot of things here for dpi
I'm confused since Linux/X.org DPI has been dynamic since the age of CRT monitors.
`xdpyinfo` would give the exact size of display in mm precision and calculate the actual, real DPI of your display from that, and that's what all programs should use so text is always the same real size regardless of display size and resolution.
Whereas Windows just used a fixed DPI value whether or not it matched your display and every display would show things at a different size.
Frustrating to hear that this is still a problem today... sorry for not offering a solution
I'm not sure. According to the ArchWiki most program use xrdb's Xft.dpi. It mentions using the value from xdpyinfo, but it makes it sound like that method is deprecated:
In any case, it doesn't matter to me why these choices were made: I'm happy to manually set
Xft.dpito my favorite value.The problem is that Chromium doesn't support any value between 97 and 127. I guess it wouldn't support those values even if it computed the DPI automatically from xdpyinfo.
that's a sad state of affairs
my monitor is older (16:10 1920x1200) so I have no hands on experience with 4K yet, didn't expect it to be that bad