WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: what dpi should be used for what resolution!?  (Read 1004 times)

Offline xor

  • Hero Member
  • *****
  • Posts: 1262
what dpi should be used for what resolution!?
« on: October 30, 2022, 10:19:31 PM »
what dpi should be used for what resolution!?

https://wiki.archlinux.org/title/xorg#Display_size_and_DPI

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: what dpi should be used for what resolution!?
« Reply #1 on: October 31, 2022, 01:23:51 AM »
This is perhaps more complicated than it looks.

If you use Xorg without configuration, it should use the native resolution of your monitor. For my laptop:
Code: [Select]
$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    1366x768 pixels (361x203 millimeters)
  resolution:    96x96 dots per inch

Note that without configuration, Xorg forces dpi=96.

..but my screen is not 361x203mm, it is approximately 276x154mm, which equates to 125dpi (calculated on the screen diagonal).

Edit: this should give the correct monitor dimensions:
Code: [Select]
xrandr | grep "connected pri"
eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 280mm x 160mm
« Last Edit: October 31, 2022, 01:32:05 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: what dpi should be used for what resolution!?
« Reply #2 on: October 31, 2022, 01:43:53 AM »
Note also:
Code: [Select]
$ xrandr --dpi 125
$ xrandr --dpi 125
$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions:    1366x768 pixels (277x156 millimeters)
  resolution:    125x125 dots per inch

..made no discernible difference to the display.

Edit: setting "Xft.dpi: 125.0" in ~/.Xdefaults makes the fonts bigger in fluxbox, but not flwm, which doesn't use libXft.
« Last Edit: October 31, 2022, 03:33:31 AM by Juanito »