You are not logged in.

#1 2018-07-06 08:46:44

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

Too small font size for some programs

I've searched for "i3 font drivers nvidia" in this forum and found no recent thread, so I'm posting a new one to avoid necro-bumping. Also, I've run `sudo pacman -Syu` less than 10 hours ago, before going to sleep.

I apologize in advance if the solution was already stated in some other question, but I swear I've searched, a lot, not only on this forum, and found no solution. Not that I haven't found related questions, answers, and wikis; I simply find very hard to understand what to do based on those wikis: I keep asking myself whether or not what I'm reading fits my case.

Indeed, I've been confused about how to deal with visual aspects of the OS since I installed Arch (especially font sizes of terminal emulator, WM, web browser, GTK-based applications, Qt-based applications, ...), just like what I see on screen depends on more variables that I can even imagine.

Specifically, I'm still facing a problem for which I already posted a question on
UnixStackExchange, where I also gave a self answer, since I thought I had found (by pure chance) the solution, at the time, consisting in uninstalling Nvidia proprietary drivers.

When I bought a new bigger monitor, I realized that I had found no solution, since the two monitors (the old one, 18", and the new one, 28") showed extremely different font sizes, when I connected them both.

So I surfed to i3's website and read "Please upgrade your nVidia driver to version 302.17 or newer and i3 will just work" and decided to do so, also because of MATLAB (I use it a lot) which suggests me to use proprietary drivers (otherwise it's slow in doing 2D and, even more, 3D graphics). (Also, I unplugged the smaller monitor telling myself that the first step must be to make things work on one monitor, and only after on two.)

So I unistalled `xf86-video-nouveau` and `mesa` (for this I had to use `sudo pacman -Rdd`; I hope this post was not too old), and installed `nvidia` and `nvidia-utils`.

Now thigs are like in this picture, where with the green lines I mean that
(1) Terminal emulator and i3wm fonts seems to be coherent with the two config files in the bottom-left corner,
(2) LXAppearance (`lxappearance`) controls at least color and icons of (for instance) the three applications in the middle colum,
(3) Qt5 Configuration Tool (`qt5ct`) controls color, icons and font size of Flameshot (I cant show, since I'm taking the screenshot);
whereas with the red lines and text I mean that
(1) the fonts in a lot of applications are definitely too small
(2) It seems to me that windows in left and middle column, as well as Rofi (not shown, since I can't keep it open while taking
a screenshot) and Dunst, all use the same microscopic font.

In closing, hoping I'm not too repetitive, I'm aware I've likely already put my eyes on the solution, but as little I could notice it as much I'm confused about this things.

Offline

#2 2018-07-06 09:11:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,275

Re: Too small font size for some programs

First off, reinstall mesa, not having it present can cause lots of issues and it doesn't conflict with the nvidia driver (the thread you link to is too old, nowadays both mesa and nvidia drivers can use coexisting GL libraries via libglvnd)

Having a second monitor that is that different from the first poses a problem. An important metric to look at in regards to proper scaling is the DPI value of your monitor. The problem here is that Xorg cannot adapt to a different DPI on a different screen on the fly. One of them will be the "master" where apps look properly scaled, while the other will have too big or too small interfaces respectively. This is one of the big pain points Wayland can help with.

If you are now trying to fix things on the bigger monitor, which is likely HiDPI capable, you should look at the information outlined in https://wiki.archlinux.org/index.php/HiDPI which provides a good overview over things to try wrt to the different toolkits and even specific applications.

Last edited by V1del (2018-07-06 09:17:58)

Online

#3 2018-07-06 11:12:36

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

Re: Too small font size for some programs

When I run `# pacman -S mesa libglvnd` they were installed already (maybe `# pacman -Syu` installed it/them back in my system).

Yes, I'm trying to fix things on the bigger monitor.

I can't believe I've passed on that page you linked without even scrolling down to discover per-application tweaks.

So far I've been able to configure Spotify, Zathura, Steam, and MATLAB. Alas, Skype and other applications (among which Rofi, PulseAudio, Audacity, NVIDIA X Server Settings, Dunst, ...) are still using a too tiny font; the latter ones are not present at that page, whereas about the former it is only written that "Skype for Linux (skypeforlinux-stable-binAUR package) uses #GTK+ 2", which seems to be not enough to get it use a good fontsize. I bet I have to dig for a solution in "Unsupported applications" section, haven't I?

I'll give a look at Wayland for the two monitor problem.

All these hardcoded configurations I've done (and will do, as soon as other applications will require) make me think that it will be a pain in the.. in there.. when I will have, for any reason, to momentarly switch to another monitor with very different size.

Last edited by Enrico1989 (2018-07-06 11:21:28)

Offline

#4 2018-07-06 11:19:27

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

Re: Too small font size for some programs

I also see different sized tray icons. Is this incoherence connected to that concerning the fonts?

Btw, I've blindly followed the instructions at that page and what I found is working, but I still haven't get why, for instance, LXAppearance doesn't change fontsize of some GUIs, while it does change colours and icons of that GUIs.

Offline

#5 2018-07-06 12:32:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 19,994
Website

Re: Too small font size for some programs

The above-mentioned DPI settings for Xorg are almost certainly what you need.  But I'm chiming in here primarily to ensure you do not waste time on unproductive searches: this has nothing to do with i3 (your WM).  A window manager manages windows, that's it.  It doesn't have settings for the interface of client programs.  The one exception to this can be a tray/status-bar if it is provided by the WM itself.  In that case the WM config will generally have an entry for the font and font size you want to use in the bar for text.

Enrico1989 wrote:

I also see different sized tray icons. Is this incoherence connected to that concerning the fonts?

Yes, if you change the DPI settings, it will change the apparent size of icons.

Enrico1989 wrote:

LXAppearance doesn't change fontsize of some GUIs, while it does change colours and icons of that GUIs.

Which ones?  LXAppearance will only affect programs that use GTK (I'm not sure even if it applies to GTK2 and GTK3, but the wiki will clarify that).  As for LXAppearance affecting some settings like colors and icons, but not font, that's not unreasonable: LXAppearance only sets the defaults for GTK widgets, client programs can either use these system-wide defaults or override them with their own settings; fonts are potentially one of the more frequently overridden settings.  In any program that doesn't use the LXAppearance font (but does use other LXAppearance settings) there is likely a configuration specific to that program to select it's font.

For example, a vte-based terminal may use gtk settings in general, but it has it's own font options.  You can generally opt to use the system default font (generally bad for a terminal) or you select your preference from a list of other fonts - at that point it will no longer follow changes to fonts from LXAppearance.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2018-07-06 13:13:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,275

Re: Too small font size for some programs

Enrico1989 wrote:

Alas, Skype and other applications (among which Rofi, PulseAudio, Audacity, NVIDIA X Server Settings, Dunst, ...)

All of these, with the exception of Rofi and potentially audacity (though it does use wxgtk and might thus be governed by the same rules) (..and by nature of what it is, dunst is almost guaranteed to have it's own config for this, as noted by Trilby), use some form of GTK3, so it seems either your font, or your scaling settings for GTK3 specifically are incorrect, look at the GTK3 section of the article and maybe post your ~/.config/gtk-3.0/settings.ini

(I'm relatively certain that the link back to the GTK2 settings is incorrect for the Skype entry...) That change happened very recently, in any case I've adjusted the wiki article.

Last edited by V1del (2018-07-06 13:46:24)

Online

#7 2018-07-06 15:12:58

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

Re: Too small font size for some programs

Trilby wrote:

But I'm chiming in here primarily to ensure you do not waste time on unproductive searches: this has nothing to do with i3 (your WM). A window manager manages windows, that's it.  It doesn't have settings for the interface of client programs.

So I just have to forget about i3 settings if they're not related to how windows are shown on screen, right? The only font I can set with i3 is the one used in the status bar, in warning and error messages (like the one I see when I want to exit i3), ...

Trilby wrote:

The one exception to this can be a tray/status-bar if it is provided by the WM itself.  In that case the WM config will generally have an entry for the font and font size you want to use in the bar for text.

Enrico1989 wrote:

I also see different sized tray icons. Is this incoherence connected to that concerning the fonts?

Yes, if you change the DPI settings, it will change the apparent size of icons.

Are you talking about the same thing before and after quoting me? I mean, are the tray icons in the picture I linked "provided by" i3? Or is i3 just reserving space on the screen for them, letting app-specific config files set the actual icon? Oh, I feel like I'm adding even more entropy to the thread! sad (But I'm getting correct font sizes, step by step smile) So have I to expect those icons to reach the correct size as soon as I'll set font sizes in their GUIs to a proper value?

Trilby wrote:
Enrico1989 wrote:

LXAppearance doesn't change fontsize of some GUIs, while it does change colours and icons of that GUIs.

Which ones?  LXAppearance will only affect programs that use GTK (I'm not sure even if it applies to GTK2 and GTK3, but the wiki will clarify that).  As for LXAppearance affecting some settings like colors and icons, but not font, that's not unreasonable: LXAppearance only sets the defaults for GTK widgets, client programs can either use these system-wide defaults or override them with their own settings; fonts are potentially one of the more frequently overridden settings.  In any program that doesn't use the LXAppearance font (but does use other LXAppearance settings) there is likely a configuration specific to that program to select it's font.

Yes, if there's only one thing I think I understood is that LXAppearance is for setting GUIs for the applications whose developers chose to use GTK. So yes, I imagine the the applications in the middle column of the first picture I linked use GTK, since their colours and icons changed when I changed settings in LXAppearance (and I was surprised font sizes didn't change, but you gave me a quite convincing explanation).

V1del wrote:

All of these, with the exception of Rofi and potentially audacity (though it does use wxgtk and might thus be governed by the same rules) (..and by nature of what it is, dunst is almost guaranteed to have it's own config for this, as noted by Trilby), use some form of GTK3, so it seems either your font, or your scaling settings for GTK3 specifically are incorrect, look at the GTK3 section of the article and maybe post your ~/.config/gtk-3.0/settings.ini

This is my ~/.config/gtk-3.0/settings.ini

[Settings]
gtk-theme-name=Arc-Dark
gtk-icon-theme-name=HighContrast
gtk-font-name=DejaVuSansMono Nerd Font 12
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull

Changing the `gtk-font-name` entry makes the menu bar font size change, but it's evident from this screenshot that Audacity uses other fonts, which are not scaled by same setting (is the wxgtk you wrote about?).

Offline

#8 2018-07-06 15:56:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,275

Re: Too small font size for some programs

Audacity is in so far a special case regardless, because it uses many custom controls (by nature of the beast, I don't think there is a audio editor of relevant complexity in existence that can suffice on standard widgets) they will have to be adjusted within the application itself if possible. Last I remember this wasn't really feasably doable, however my info might be outdated.

Online

#9 2018-07-06 16:02:41

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

Configuring fonts will only get you a partial solution - apps might still use hardcoded fonts - especially "browser apps" (ie. css)

What's the output of "xrandr -q" and "xdpyinfo | grep resolution"?
As for X11 there're basically two ways to deal with this:
1. pick a middle-ground DPI (too high for one and too low for the other monitor, but  bearable)
2. Harmonize the output DPIs (scaling and/or panning)

Offline

#10 2018-07-06 16:47:41

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

Re: Too small font size for some programs

Ok, it was easy to change font size for Dunst, through its config file.

seth wrote:

Configuring fonts will only get you a partial solution - apps might still use hardcoded fonts - especially "browser apps" (ie. css)

For what concerns Rofi, it "should" have changed its font automatically (maybe taking the settings from terminal emulator setting?) but I am using the theme arthur.rasi, which - together with c64.rasi and dmenu.rasi - hardcodes the font, thus taking the precedence also over the `rofi.font:` entry I was trying to put in `.config/rofi/config`. Finally I've copied some *.rasi file in `.config/rofi/.` so that I can remove font settings and maybe play with the others.



V1del wrote:

Audacity is in so far a special case regardless, because it uses many custom controls (by nature of the beast, I don't think there is a audio editor of relevant complexity in existence that can suffice on standard widgets) they will have to be adjusted within the application itself if possible. Last I remember this wasn't really feasably doable, however my info might be outdated.

I haven't found a way to set fonts in Audacity if that's what you mean (except setting one out of five possible themes in the "Interface" section of "Preferences").

seth wrote:

What's the output of "xrandr -q" and "xdpyinfo | grep resolution"?

The former is

Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
DVI-D-0 disconnected primary (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 connected 3840x2160+0+0 (normal left inverted right x axis y axis) 607mm x 345mm
   3840x2160     60.00*+  30.00  
   2560x1440     59.95  
   1920x1080     60.00    59.94  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
DP-5 disconnected (normal left inverted right x axis y axis)

the latter is `159x156 dots per inch`.

Last edited by Enrico1989 (2018-07-06 16:56:55)

Offline

#11 2018-07-06 17:07:26

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

That's only one output (28") and the DPI are correct - I assume everything looks ok on the 28" monitor?
The idea was to check the phyiscal resolution of the 18" monitor to see what makes sense to deal w/ the conflict.

Offline

#12 2018-07-06 18:01:30

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

Re: Too small font size for some programs

Well for the monitor 28" I just have to set the fontsize for the LightDM GTK+ Greeter and understand what to do for Skype, whereas, for the poroblem in its generality, I think I have to accept that there's no consistent way of setting the fonts all together. But it still seems a bit absurd to me

Enrico1989 wrote:

All these hardcoded configurations I've done (and will do, as soon as other applications will require) make me think that it will be a pain in the.. in there.. when I will have, for any reason, to momentarly switch to another monitor with very different size.

For what concerns the 18", I've let it unplugged intentionally so far, to concentrate on one thing at a time.

Now that almost everything looks ok on the 28" monitor, this is the rest of the output you asked for, relative to the 18" monitor.

HDMI-0 connected 1360x768+0+1392 (normal left inverted right x axis y axis) 160mm x 90mm
   1360x768      60.02*+
   1920x1080     59.94    50.00    29.97    25.00    23.98    60.05    60.00    50.04  
   1280x720      60.00    59.94    50.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94

Offline

#13 2018-07-06 18:32:09

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

HDMI-0 connected 1360x768+0+1392 (normal left inverted right x axis y axis) 160mm x 90mm

This is one of your problems, the monitor shows up as 160x90mm what's closer to 7" on a 16:9 ratio.
The result are staggering 216 dpi - even at lousy 1360x768.
The actual value for a 16:9 monitor @1360x768 would be 87dpi, for 1920x1080 it would be 122 dpi - what's not all that far from 160 dpi.

Try to run them at 1920x1080 and 3840x2160 and

xrandr --dpi 140

Processes start *afterwards* should pick up that DPI. If you're ok with the compromise, ensure your screen config and since you're on nvidia,
/etc/X11/xorg.conf.d/20-nvidia.conf

Section "Device"
    Identifier "Default nvidia Device"
    Driver	"nvidia"
    Option	"NoLogo"				"True" # no spam
	Option	"CoolBits"				"24" # more options in nvidia-settings
	Option  "DPI"					"140x140" # the crucial setting
	Option	"UseEdidDpi"			"False" # better be safe than sorry
EndSection

Offline

#14 2018-07-07 14:42:56

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

Re: Too small font size for some programs

seth wrote:

Try to run them at 1920x1080 and 3840x2160 and

xrandr --dpi 140

It seems to have no effect (does it mean that the small monitor can't handle 1920x1080?). Anyway I've "forced" it by using the GUI (ARandR), but everything becomes too crispy on that monitor and the colours get... "burnt" (I don't know how to describe in english, but "burn" is the name of a photoshop tool that has a similar effect, so I hope the word can make you understand). So I've reset the original resolution of 1360x768 (actually I think my monitor should handle 1366x768, at least I remember Windows choosing that automatically and not allowing anything more).

Is that 140 the number you referred to in your previous message?

seth wrote:

1. pick a middle-ground DPI (too high for one and too low for the other monitor, but  bearable)

What I'm trying now, is to run

xrandr --output HDMI-0 --mode 1360x768 --scale 2x2 --pos 0x1392 --output DP-4 --mode 3840x2160 --pos 1360x0

to fix both monitors' resolution, position, and doubling the scale of the former, but I get a strange behavior, like my mouse can move in workspace bigger than the two monitors, and when I move beyond the border of a monitor, the workspace slides to show missing area; oh, and the two monitors have a bit of overlap with each other.

I've also tried with

xrandr --output HDMI-0 --scale 1.9x1.9

(where 1.9 comes from 160dpi/1360pxl*16.14") and tring to use ARandR to position the the monitors relative to each other; but when I hit apply, they get moved in the way they overlap and my mouse can move on the whole gray area where the two miniatures of the monitors lie in ARandR GUI (basically it's the same behavior I mentioned in the previous paragraph).

In the end it seems that

xrandr --output HDMI-0 --scale 2x2

looks quite good.

Now I just have to put it in /etc/X11/xorg.conf.d/20-nvidia.conf.

Last edited by Enrico1989 (2018-07-07 14:44:00)

Offline

#15 2018-07-07 15:26:33

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

The connection or the monitor probably only can do 1920x1080 at a lower frequency (29.97  or 25.00 Hz)
You likely want to position the DP-4 output at 2720x0 (2*1360) and likewise the HDMI monitor at 0x624.

Since you mentioned arandr: there's a chance that some tool at the session start alters resolutions and DPI. If you cannot prevent this, ensure to update the DPI w/ xrandr afterwards once more. However processes started before the DPI is set/updated will not pick the update and continue on the former DPI. ("Because of lazy programming" ;-)

Offline

#16 2018-07-07 15:52:43

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

Re: Too small font size for some programs

Oh, sure, the position acts after --scale! So this is the line:

xrandr --output HDMI-0 --mode 1360x768 --scale 2x2 --pos 0x624 --output DP-4 --mode 3840x2160 --pos 2720x0

Offline

#17 2018-07-07 21:17:33

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

Re: Too small font size for some programs

This is /etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier "DP-0"
    Option     "PreferredMode" "3840x2160"
    Option     "Position" "2720 0"
    Option     "Primary" "true"
EndSection

Section "Monitor"
    Identifier "HDMI-0"
    Option     "PreferredMode" "1360x768"
    Option     "Position" "0 624"
    Option     "Primary" "false"
EndSection

whereas this is /etc/X11/xorg.conf.d/20-nvidia.conf

Section "Device"
    Identifier "Default nvidia Device"
    Driver     "nvidia"
    Option     "CoolBits"   "24"
    Option     "DPI"        "160x160"
    Option     "UseEdidDpi" "False"
EndSection

but the relative position of the monitors is not the one I'm requesting.

In the following images the result of using none, both, the one, and the other file.
none
both 10-monitor.conf 20-nvidia.conf
only 10-monitor.conf
only 20-nvidia.conf

Offline

#18 2018-07-07 22:08:34

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

Re: Too small font size for some programs

Enrico1989 wrote:
xrandr --output HDMI-0 --mode 1360x768 --scale 2x2 --pos 0x624 --output DP-4 --mode 3840x2160 --pos 2720x0

As a temporary solution (temporary because I'd like to understand how to make things work the right way), I've add that command to i3's config file (it takes a moment when i3 starts for the command to take effect, though).

Offline

#19 2018-07-07 22:56:57

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

Since the HDMI output is positioned right of the DP one, I'd say some other config script already has to kick in (some arandr autostart file or "nvidia-settings -l" call?)
However and afaics scaling isn't supported by the xorg config, so you'll have to use nvidia's metamodes.
You can generate the required screen section using nvidia-settings. It'll pick up the present randr changes. Just write the config into a file (not! /etc/X11/xorg.conf) and extract the "Screen" section into the nvidia configlet (make sure to sync the Device ID)

Offline

#20 2018-07-08 07:19:10

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

Re: Too small font size for some programs

seth wrote:

Since the HDMI output is positioned right of the DP one

If by output you mean the physical device, it is positioned left of the DP, and their lower sides are aligned. The layout I'm trying to obtain is the following, where `*2` is the scaling.

                          (2720,0)----------------------------+
                          |                                   |
(0,624)------------------+|                                   |
|                        ||           3840 x 2160             |
|     1360*2 x 768*2     ||               PD-0                |
|         HDMI-0         ||                                   |
|                        ||                                   |
+------------------------++-----------------------------------+
seth wrote:

I'd say some other config script already has to kick in (some arandr autostart file or "nvidia-settings -l" call?)

Where should I look for these files?

seth wrote:

You can generate the required screen section using nvidia-settings. It'll pick up the present randr changes.

So you mean I should use xrandr to set up the desired layout (with the command in my previous message), then open nvidia-settings (I'm using the GUI), click on "Save to X Configuration File" and

seth wrote:

Just write the config into a file (not! /etc/X11/xorg.conf) and extract the "Screen" section into the nvidia configlet (make sure to sync the Device ID)

Here the save is just to access the file contents, take the "Screen" section, and then throw it away, right?
Then where shoul I put this extracted section?

Offline

#21 2018-07-08 07:35:32

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

No, I meant "in the screenshot" - this doesn't happen. If settings were just ignored, the outputs would overlap (both starting a 0x0)
Unfortunately I have no idea what causes the setting you initially face - it will be something run by your session startup scripts.

find ~ -iname '*autostart*'

might get you somewhere
If you're using some DM (GDM, SDDM, …) and the layout is the same there, it will be rather in its config scripts.

Just add it to 20-nvidia.conf - again: ensure you keep the device IDs in sync (the one in the screen section and the one you wrote)
Unless however you can stop the other (session related) config, this is moot.

Offline

#22 2018-07-08 08:09:38

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

Re: Too small font size for some programs

This is /etc/X11/xorg.conf.d/20-nvidia.conf

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "HDMI-0: nvidia-auto-select +0+624 {viewportin=2720x1536}, DP-0: nvidia-auto-select +2720+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Device"
    Identifier "Default nvidia Device"
    Driver     "nvidia"
    Option     "CoolBits"   "24"
    Option     "DPI"        "160x160" # the crucial setting
    Option     "UseEdidDpi" "False"   # better be safe than sorry
EndSection

But now i3's status bar on the small monitor goes from (0,half) to (half,half), just like it hasn't undergone the scaling...

(Btw, what should I do with the /etc/X11/xorg.conf.d/10-monitor.conf file?

In the meanwhile, I've been searching on the web. I've come back to i3's User Guide, since there it's claimed that "i3 was specifically developed with support for multiple monitors in mind". Here I've found basically what I did before.. It seems like a "normal" thing to do. So I've written a very simple shell script to run the "long" xrandr command when both monitors are plugged in or simply `xrandr --auto` in only one is plugged (just to avoid heartattacks in case I forgot turning on either monitor).

What do you think about this approach (wrt using .conf files)?

Last edited by Enrico1989 (2018-07-08 09:18:13)

Offline

#23 2018-07-08 14:28:34

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

It ultimately doesn't matter *how* you get to the desired configuration ;-)
A dynamic approach (eg. using https://keithp.com/blogs/x-on-resize/) is more flexible where an xorg config doesn't rely on a session or some user daemon.

Is the layout "correct" (as intended) in lightdm?
Idk enough about i3, but the misaligned i3 statusbar would then suggest that there's some randr event ("unscaling" the output) during the i3 start, it picks that resolution, misses a following randr event (your xrandr call still in place?) and is stuck w/ the old statusbar geometry.

Offline

#24 2018-07-08 16:05:56

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

Re: Too small font size for some programs

seth wrote:

Is the layout "correct" (as intended) in lightdm?

Nope, the greeter uses a very tiny font (since, the i3 command acts after the login). I just have to enter the password there, so it's not really a problem, but having a solution would be nice.

Btw, I've given a look into my Windows 10 install (in dual but with Arch), and the fontsize is so tiny as well.

seth wrote:

Idk enough about i3, but the misaligned i3 statusbar would then suggest that there's some randr event ("unscaling" the output) during the i3 start, it picks that resolution, misses a following randr event (your xrandr call still in place?) and is stuck w/ the old statusbar geometry.

Well, it is still in place, in that I tell i3 to run the following command as soon as it is (re)started (re=I can plug/unplug either monitor - not both, ahahah - and i3 will adapt)

xrandr | grep -q "HDMI-0 *\<connected" && \
    xrandr --output HDMI-0 --mode 1360x768 --scale 2x2 --pos 0x624 \
           --output DP-0 --mode 3840x2160 --pos 2720x0 --primary ||
    xrandr --auto
seth wrote:

It ultimately doesn't matter *how* you get to the desired configuration ;-)

Well, I imagine it matters if I will change a monitor or add one more, or simply change the relative position of the two physical monitors.

Struggling to resolve problems is nice, in general, but I'm having the impression that the solution actually consists in hardcoding numbers in several configuration files (terminal emulator, i3, ...), or in settings sections of the programs (qutebrowser, ...), or in configuration utilities (LXAppearance, Qt settings, ...). I mean, solving this problem seems just a matter of collecting and using dozens of ad hoc tips and tricks that won't work tomorrow. And that words in bold and italic... make the idea of struggling against this visual-related problems much less attractive.

Offline

#25 2018-07-08 20:15:34

seth
Member
Registered: 2012-09-03
Posts: 8,255

Re: Too small font size for some programs

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), but more interesting than the actual font size is whether the font sizes are about the same on both monitors, ie. whether the scaling takes place. (You can also log into VT2 or via ssh while lightdm shows and "xrandr --display :0 -q" to see the present setup in numbers)

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 for windows: it should (like wayland) support one DPI per output, but the Win32 API is iirc completely DPI unaware - you can render at 72 or 96 DPI and that's it. So many windows clients will just not use the proper DPI, even if the OS knows it. (This btw. also holds for a couple of "legacy" X11 clients with homebrew font rendering code)

Offline

Board footer

Powered by FluxBB