You are not logged in.

#26 2018-07-09 06:25:26

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Too small font size for some programs

seth wrote:

Jest a heads up: the Device IDs in your  20-nvidia.conf do not match, so you won't enforce the 160dpi (probably resulting in the tiny font in lightdm)

Are you referring to this line?

Identifier "Default nvidia Device"

Should I put here the ID which xrandr uses for the big monitor? (DP-0 in my case (yes, it was DP-4, but when plugging and unplugging under the desk I finally changed it, to avoid hitting my head to death).)

seth wrote:

Hardcoding font sizes in clients won't cut it since you're still dealing w/ outputs w/ significantly different physical DPIs, so there simply is no font size that will fix it for both outputs at once (because of the single DPI limitation in X11).
You *have* to align the physical DPIs of both outputs (and then ensure X11 uses the desired DPI and not some false calculation, estimated from the actual geometries of one of the outputs)

As in, if I change my hardware video configuration, I necessarily have to intervene a manually set font sizes in the most acceptable way (since no perfect way exists).

Offline

#27 2018-07-09 07:41:18

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Too small font size for some programs

No, the line

Device         "Device0"

in the Screen section should read

Device         "Default nvidia Device"

Offline

#28 2018-07-09 18:12:54

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Too small font size for some programs

Ok, done it, but the login still has a too tiny font.

Offline

#29 2018-07-09 18:49:05

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Too small font size for some programs

Switch to another VT and check "xdpyinfo --display :0" there on which resolution is set. Also inspect the xorg log on which is configured.
If they diverge, lightdm sets it to the wrong value.
If it seems correct in both instances, the xorg conf works, but the lightdm greeter is simply DPI unaware
If it's wrong in the log. something is off w/ the config (please paste the log in that case)

Offline

#30 2018-07-12 16:50:44

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Too small font size for some programs

Sorry for the late reply.

I've run `xdpyinfo -display :0` (it is one dash only, in case other readers read this post) and it gives the same result as in the terminal emulator in current x session.
The part of the output you're probably referring to is

screen #0:
  dimensions:    6560x2160 pixels (1041x343 millimeters)
  resolution:    160x160 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32

What log files are you referring to?

The file that I pasted a few messages ago, /etc/X11/xorg.conf.d/10-monitor.conf, is still absent (it's renamed in the home), since I havent understood what to do with it as compared to 20-nvidia.conf, 90-monitor.conf, ... In addition, I've noticed other similar files in /usr/share/X11/xorg.conf.d/, which I think play a role as well.

Offline

#31 2018-07-12 19:19:32

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Too small font size for some programs

Xorg log, https://wiki.archlinux.org/index.php/Xorg#General
However, the resolution is the desired and set one, so that's fine - lightdm just (apparently, not using lightdm myself) ignores it.
Which greeter do you use?

Offline

#32 2018-07-12 19:40:09

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Too small font size for some programs

[Desktop Entry]
Name=LightDM GTK+ Greeter
Comment=This runs the GTK+ greeter, it should only be run from LightDM
Exec=env GTK_THEME=Adwaita:dark lightdm-gtk-greeter
Type=Application
X-Ubuntu-Gettext-Domain=lightdm

This is the config file /usr/share/xgreeters/lightdm-gtk-greeter.desktop of the greeter. Maybe I could add some setting here?

Offline

#33 2018-07-12 21:00:15

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Too small font size for some programs

Exec=env GDK_SCALE=2 GTK_THEME=Adwaita:dark lightdm-gtk-greeter

GDK_DPI_SCALE=2 should only scale the font (the above should scale everything)

Offline

#34 2018-07-14 07:35:38

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Too small font size for some programs

Wow, it seems it works!

Btw, while doing a couple of experiments with GDK_DPI_SCALE and GDK_SCALE before applying it to the greeter, I've run `GDK_SCALE=2 GDK_DPI_SCALE=0.5 GTK_THEME=Adwaita:dark audacity`, which gives a more consistent set of fonts for Audacity (there still some "intruder" font which is too small or too big; also, `GDK_DPI_SCALE=0.5` scales the font of menu bar, buttons, and so on, to the size of "other" tiny fonts, while `GDK_SCALE=2` scales them both up; unfortunately, that "2" is too much, but it seems that GDK_SCALE can't be fractional, unlike GDK_DPI_SCALE).

Is it common practice to create programs which pick font options from every single possible source?

EDIT
After a restart, menu bar fonts seemed a bit decreased, so I finally decided that `Exec=env GDK_DPI_SCALE=0.75 GDK_SCALE=2 UBUNTU_MENUPROXY=0 audacity %F` in Audacity's desktop file is acceptable. The same trick also works for Skype.

Now I think I've had enough informations to set fonts size of applications as soon as I find one with too small/big fonts; for what concerns monitors/screens and graphic drivers I've understood much less, and I think I'm not able to confortably "play" with xx-something.conf files in /etc/X11/xorg.conf.d and /usr/share/X11/xorg.conf.d, so I'd rather keep this thread open to ask other related question. On the other hand, I think the problem connected with the title and described in the first post is solved, so what should I do? Mark it as solved and keep writing if I need to? Let it unsolved? Mark it as solved and DON'T keep writing?

Last edited by Enrico1989 (2018-07-14 09:01:12)

Offline

#35 2018-07-14 12:08:16

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Too small font size for some programs

There's no "common practice", HiDPI is a mess. (In an idieal world, all applications would just check the logical DPI, compare that to an assumed default like 72 or 96 dpi, and scale accordingly - but this certainly is no ideal world at all)
The GDK_* environment will only work on things that utilize GDK (mainly gtk3 applications), for Qt there other settings, etcetc. see the HiDPI arch wiki page.

Offline

Board footer

Powered by FluxBB