Page 1 of 1

[SOLVED] [14.1 MATE] Where to set custom DPI?

Posted: 31. Jan 2015, 06:44
by john256
Setting up SalixOS 14.1 MATE on a PC with a larger screen, I needed to slightly increase the DPI from its default of "96" to have more readable fonts.

Now, adding "-dpi 100" to defaultserverargs= in /usr/bin/startx didn't change the DPI to the desired value:

Code: Select all

> xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    1920x1080 pixels (507x285 millimeters)
  resolution:    96x96 dots per inch
Is there another method to set DPI for X?

BTW i noticed that /usr/bin/startx contain a lot of blank lines...

Re: [14.1 MATE] Where to set DPI?

Posted: 31. Jan 2015, 10:41
by gapan
In MATE System Menu/Preferences/Appearance/Fonts tab/Details button.

Re: [14.1 MATE] Where to set DPI?

Posted: 31. Jan 2015, 18:22
by john256
gapan wrote:In MATE System Menu/Preferences/Appearance/Fonts tab/Details button.
It was the first thing I did, but xdpyinfo still says "96x96" so not all the apps seem to recognize the Fonts/Details setting, so I assume that it needs to be set globally somewhere else...

Re: [14.1 MATE] Where to set DPI?

Posted: 31. Jan 2015, 23:21
by gapan
You can also set it in ~/.Xresources for apps that don't behave.

Re: [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 11:03
by john256
gapan wrote:You can also set it in ~/.Xresources for apps that don't behave.
Done that as well - still no go :-(

Re: [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 12:43
by laprjns
No expert here, but maybe this explains the problem.
https://bugs.launchpad.net/ubuntu/+sour ... bug/589485.

A suggested work around is to use xranda. Changing the dpi using xranda does seem to change what is reported by xdpyinfo but it does not change the size used by Mate; at least not the instant change you get when using the "MATE System Menu/Preferences/Appearance/Fonts tab/Details button"

Code: Select all

rich[~]$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    1920x1080 pixels (508x285 millimeters)
  resolution:    96x96 dots per inch
rich[~]$ 
rich[~]$ 
rich[~]$ xrandr --dpi 120
rich[~]$ 
rich[~]$ 
rich[~]$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    1920x1080 pixels (406x228 millimeters)
  resolution:    120x120 dots per inch

Re: [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 13:11
by gapan
john256 wrote:
gapan wrote:You can also set it in ~/.Xresources for apps that don't behave.
Done that as well - still no go :-(
Did you logout/login?

Re: [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 13:12
by john256
Thanks to your hint I refined my search and found that the recommended way to set the correct DPI is through the GDM configuration-file /etc/gdm/custom.conf

Under the "[servers]" section I copied over the default settings from /usr/share/gdm/defaults.conf, and just added "-dpi 100" after "command=/usr/bin/X":

Code: Select all

[server-Standard]
name=Standard server
command=/usr/bin/X -dpi 100 -audit 0
flexible=true
I am not sure, though, if all the default settings are needed, or just the modified line (#3), but for now things work as expected ;-)

Re: [SOLVED] [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 13:47
by john256
One more thing: while Firefox does scale the font in the UI elements accordingly, the web-page contents is not affected by the tweak.
To fix that, layout.css.devPixelsPerPx in about:config needs to be set to a value = dpi /96.

Re: [SOLVED] [14.1 MATE] Where to set DPI?

Posted: 1. Feb 2015, 13:58
by john256
To sum up:
1) x-session: /etc/gdm/custom.conf via "command=/usr/bin/X -dpi XYZ -audit 0"
2) user, most applications: Preferences>Appearance>Fonts>Details...>Resolution
3) user, other applications: ~/.Xresources - "Xft.dpi: XYZ"
4) user, Firefox web-page contents: about:config - "layout.css.devPixelsPerPx"