You are not logged in.

#1 2017-10-05 02:24:55

kleshas
Member
Registered: 2015-12-16
Posts: 10

DPI on archx64 xfce

Got a somewhat trivial issue at the moment.  I have 2 Dell u2410 LCDs, connected to an nVidia 950GTX, using latest nvidia drivers.

1920*1200 24" LCD has a DPI of 94.  Confirmed at Dell site and via measuring the screen (518mm * 324mm, 1920x1200)
However the system wants to run at 96, and looks better at that DPI too.  xdpyinfo shows the incorrect physical measurements and hence DPI.  xrandr shows the correct ones.

xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    3840x1200 pixels (1016x318 millimeters)
  resolution:    96x96 dots per inch

xrandr

Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+  59.88  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+  59.88  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94

Note that the dimensions are correct for Dell U2410 (518 * 324)

According to wiki:
The DPI of the X server is determined in the following manner:
1. The -dpi command line option has highest priority.
2. If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.
3. If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.
4. If DDC does not specify a size, 75 DPI is used by default.

/etc/X11/xorg.conf

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 387.12  (builduser@anthraxx)  Wed Oct  4 17:28:30 CEST 2017

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 384.90  (buildmeister@swio-display-x86-rhel47-05)  Tue Sep 19 18:13:03 PDT 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL U2410"
    DisplaySize     518    324 #in mm
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
    Option         "DPI" "94 x 94"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 950"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Coolbits" "4"
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "DVI-I-1: 1920x1200_60 +0+0, DVI-D-0: 1920x1200_60 +1920+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Note that I also added the Option "DPI" "94 x 94" as per the wiki to xorg.conf as well.

Even though xdpyinfo isn't picking up the settings in xorg.conf, the system looks better at 96DPI as below.  Note the fixed width of "Appearance" seems broken at 94.

94DPI image here
96DPI image here

Last edited by kleshas (2017-10-05 03:08:22)

Offline

#2 2017-10-05 02:36:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: DPI on archx64 xfce

Read the Code of Conduct and use code tags and don't post oversized images: http://wiki.archlinux.org/index.php/Cod … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-10-05 09:00:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,874

Re: DPI on archx64 xfce

No idea what this is about, just three things:
1. the DPI option will work in either the device or screen section, but not a monitor setion. There is no per-monitor DPI in X11.
2. don't use nvidia-xconfig nor a static xorg.conf at all - configuration is reasonably done via xorg.conf.d/* configlets.
3. the "wrong" dimensions in xdpyinfo are calculated from the "wrong" (logical) DPI, so the 96x96 cause  the 1016x318, not the other way round.

Offline

#4 2017-10-05 09:35:04

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DPI on archx64 xfce

See my XFCE DPI bug report.

Along with that patch, can use in ~/.xinitrc one of e.g.:

xrandr --dpi 120  # When horizontal and vertical DPI are the same
... or...
xrandr --fbmm 374x228

Offline

#5 2017-10-05 18:46:58

kleshas
Member
Registered: 2015-12-16
Posts: 10

Re: DPI on archx64 xfce

seth wrote:

No idea what this is about, just three things:
1. the DPI option will work in either the device or screen section, but not a monitor setion. There is no per-monitor DPI in X11.
2. don't use nvidia-xconfig nor a static xorg.conf at all - configuration is reasonably done via xorg.conf.d/* configlets.
3. the "wrong" dimensions in xdpyinfo are calculated from the "wrong" (logical) DPI, so the 96x96 cause  the 1016x318, not the other way round.

1. - I never tried the DPI option, just the DisplaySize and nvidia entry.  To confirm, I tried the DisplaySize in Device and Screen, and Xorg crashed both times.
2. why not?  Shouldn't it work in xorg.conf?  Separate to that question, I had the same results when trying the xorg.conf.d entry (I copied the xorg.conf to 10-monitor.conf in /etc/X11/xorg.conf.d/)

brebs - how do I apply that patch? (if I read your post correctly, I would need that patch as well as the xrandr entry in .xinitrc?)

Offline

#6 2017-10-05 19:20:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,874

Re: DPI on archx64 xfce

Section "Monitor"
    Identifier     "Monitor0"
   ... 
   Option         "DPI" "94 x 94"
EndSection

And no, DisplaySize does not belong there - nobody said that.

static xorg.conf is deprecated and discouraged because it tends to contain a lot of nonsense - notably when created w/ automatic tools and shadow relevant configlets provided with driver packages etc.
Eg. yours contains calls to the "kbd" and "mouse" drivers which are kinda pre-historic and very most likely not installed on your system. Cruft.

Offline

#7 2017-10-05 21:18:21

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DPI on archx64 xfce

The problem, IIRC, is that XFCE's "Settings - Appearance - Fonts - DPI" option will *always* overrule Xorg's DPI. Without the patch I posted.

Offline

#8 2017-10-05 21:49:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,874

Re: DPI on archx64 xfce

So much I got - just pointed out that the entry in the Monitor section can't be expected to work regardless of this.
The xfce bug seems a bit weir, eg. HiDPI monitors (where this really becomes a problem) are not exactly around since only yesterday ... at least the value should be neither default nor hardcoded.
Oh, well...

Offline

#9 2017-10-05 22:07:13

kleshas
Member
Registered: 2015-12-16
Posts: 10

Re: DPI on archx64 xfce

brebs wrote:

The problem, IIRC, is that XFCE's "Settings - Appearance - Fonts - DPI" option will *always* overrule Xorg's DPI. Without the patch I posted.

But changing that setting to 94, which matches my LCDs' DPI makes things look worse.  THAT is my perceived problem here.  Plus, as you CAN change that setting, I don't see why it's a problem - just set it to match whatever you think the DPI should be and all should be good, no?

Offline

#10 2017-10-05 23:31:38

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DPI on archx64 xfce

If the *actual screen* dimensions were 508x317, then that would be almost a perfect fit for 96 DPI.

(There are 25.4 millimetres per inch.)

1920 / 508 * 25.4 = 96 exactly.
1200/ / 317 * 25.4 = 96.151...

So, stay with 96. Or rather, 96x96 wink

96 is/was a very common standard, because e.g. 96 is divisible by many other numbers.

DPI is actually 2 numbers which could be different, e.g. 110x120.

Offline

#11 2017-10-05 23:50:50

kleshas
Member
Registered: 2015-12-16
Posts: 10

Re: DPI on archx64 xfce

But the actual screen dimensions AREN'T 508x317.  They're 518x324.  Which is 94x94.
Am I not getting something?  I still want to know why things look bad at 94DPI (natural DPI of monitors).

Offline

#12 2017-10-06 07:17:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,874

Re: DPI on archx64 xfce

They actually don't look "bad" on the images you provided (checked them on another device?).
The aspect changes a bit (but that's probably a hinting thing and might vary across fonts used)

Does this affect all toolkits? How do fonts look like in xterm on 94 / 96 DPI?
Some mess-up with subpixel rendering? Do you get colored borders?

Offline

#13 2017-10-06 22:40:39

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DPI on archx64 xfce

kleshas wrote:

Which is 94x94

Kindly quit, as a newbie who clearly doesn't want to google for himself, being so engrossed in a value which is so close to the far-more-enticing 96.

Edit: spelling

Last edited by brebs (2017-10-07 11:49:20)

Offline

#14 2017-10-07 20:11:14

kleshas
Member
Registered: 2015-12-16
Posts: 10

Re: DPI on archx64 xfce

seth wrote:

They actually don't look "bad" on the images you provided (checked them on another device?).
The aspect changes a bit (but that's probably a hinting thing and might vary across fonts used)

Does this affect all toolkits? How do fonts look like in xterm on 94 / 96 DPI?
Some mess-up with subpixel rendering? Do you get colored borders?

For sure, they don't look bad, per se.  But that kerning on the 94 setting... yeesh. 
Xterm and xfce4-terminal both look ok, but the xfce4 terminal has a height change between 95 and 96, widths don't change from what I can tell.
I've not noticed coloured borders.  Hinting changes things, mainly medium to slight, medium and full look the same.  In all cases Slight looks the best.

Oh well, interesting thread, brebs rudeness in his last post notwithstanding.  I find it odd that the wiki on Xorg has all that information about DPI settings but doesn't mention that they all get ignored.

Last edited by kleshas (2017-10-07 20:14:23)

Offline

#15 2017-10-07 20:33:58

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DPI on archx64 xfce

kleshas wrote:

they all get ignored.

... which is a bug in XFCE. I believe that most other desktop environments / window managers, do not interfere with DPI.

Note that 96 DPI is *low* - it is a struggle to get fonts looking good at such low DPI, even with sub-pixel rendering. 120 DPI is much better.

Offline

#16 2017-10-07 21:04:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,874

Re: DPI on archx64 xfce

You're aware that the only difference in the posted images is the bold "Appearance" title which is actually more condensed in the shot that say 94dpi?

Offline

Board footer

Powered by FluxBB