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

Other talk about Salix
Post Reply
User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

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

Post by john256 » 31. Jan 2015, 06:44

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...
Last edited by john256 on 1. Feb 2015, 13:58, edited 2 times in total.

User avatar
gapan
Salix Wizard
Posts: 5537
Joined: 6. Jun 2009, 17:40

Re: [14.1 MATE] Where to set DPI?

Post by gapan » 31. Jan 2015, 10:41

In MATE System Menu/Preferences/Appearance/Fonts tab/Details button.
Image
Image

User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

Re: [14.1 MATE] Where to set DPI?

Post by john256 » 31. Jan 2015, 18:22

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...

User avatar
gapan
Salix Wizard
Posts: 5537
Joined: 6. Jun 2009, 17:40

Re: [14.1 MATE] Where to set DPI?

Post by gapan » 31. Jan 2015, 23:21

You can also set it in ~/.Xresources for apps that don't behave.
Image
Image

User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

Re: [14.1 MATE] Where to set DPI?

Post by john256 » 1. Feb 2015, 11:03

gapan wrote:You can also set it in ~/.Xresources for apps that don't behave.
Done that as well - still no go :-(

User avatar
laprjns
Salix Warrior
Posts: 1039
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: [14.1 MATE] Where to set DPI?

Post by laprjns » 1. Feb 2015, 12:43

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
“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"

User avatar
gapan
Salix Wizard
Posts: 5537
Joined: 6. Jun 2009, 17:40

Re: [14.1 MATE] Where to set DPI?

Post by gapan » 1. Feb 2015, 13:11

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?
Image
Image

User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

Re: [14.1 MATE] Where to set DPI?

Post by john256 » 1. Feb 2015, 13:12

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 ;-)

User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

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

Post by john256 » 1. Feb 2015, 13:47

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.

User avatar
john256
Posts: 89
Joined: 1. Jun 2011, 07:52

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

Post by john256 » 1. Feb 2015, 13:58

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"

Post Reply