X server sets invalid DPI

Simon Farnsworth simon.farnsworth at onelan.com
Wed Jan 23 10:13:33 PST 2013


On Wednesday 23 January 2013 18:38:41 Nicolas Mailhot wrote:
> 
> Le Mar 22 janvier 2013 09:39, Steven Newbury a écrit :
> 
> > I thought the eventual resolution to the previous flamewars on this
> > topic was that the whole idea of an X (DISPLAY) DPI was invalid (due to
> > multi-screen and viewing distances) so 96 DPI was chosen as it was the
> > default specified by various GUIs.
> 
> This was wishful developer thinking (I don't want to fix dpi handling so
> I'll pretend the problem does not exist). It's been thoroughly invalidated
> now that there are high-density screens on the market (as everyone could
> see would happen someday). There is no way a simple configuration like a
> low-dpi laptop plugged on a high-dpi screen will work if the presentation
> layer does not learn to handle the actual dpi differences between hardware
> monitors.
> 
X is already up to speed with this - we're waiting for the applications to 
catch up.

RandR 1.2 exposes all the information available to the X server - the screen 
size in mm for each output, the locations of each output in pixels, and the 
size of each output in pixels. An application aiming to keep things the same 
size in mm on every output can do so by working in mm internally, and using 
RandR information to convert mm to pixels on output. What's more, RandR 
information is updated on hotplug, complete with events so that applications 
can recompute their scaling factors when the displays change.

X11 also has the concept of a DPI for the display fixed at server start time - 
this is the DPI setting that defaults to 96 DPI unless overriden in the 
configuration or by command line option. The trouble with this DPI figure 
(commonly used by applications, unfortunately) is that there is no right 
answer - at least 96 DPI is consistently wrong, whereas a figure chosen by 
reading EDID of any monitors attached at startup varies.
-- 
Simon Farnsworth
Software Engineer
ONELAN Ltd
http://www.onelan.com


More information about the xorg mailing list