The DPI problem

Nikolaus Rath Nikolaus at rath.org
Thu Dec 18 18:21:48 GMT 2008


Hello,

I have tried to address the following issue by filing bug reports on
several individual applications. However, this remained by and large
unsuccessful, since there seems to be no consensus on where the
problem actually lies. For that reason, I'm raising the issue here.

The root of the problem is that there are currently two different
values of the screen resolution:

 1. The X11 server's value
 2. The value from the gnome font properties.

The X11 value is automatically calculated from the monitor resolution
and monitor dimensions. It distinguishes between horizontal and
vertical dpi. It can be set by manually specifying the monitor
dimensions in /etc/X11/xorg.conf or by using xrandr --dpi. There is no
graphical way to see or change it.

The gnome DPI is set to 96 by default and can be changed and viewed
graphically. There is no distinction between horizontal and vertical.


Problems now arise because different applications use these two values
for different things, e.g:

 - The gnome value is used to render fonts in gnome applications.
   According to gnome developers, the gnome value should be chosen to
   get a good *angular* resolution, so the correct value depends on
   the distance between monitor and user.

 - Applications like OpenOffice however, also use the gnome value to
   calculate the physical size of the display. So if the gnome value
   does not match the physical dpi, an A4 page shown at 100% zoom does
   not have the size of an A4 page.

 - Applications like evince use both values. The physical dimensions
   are calculated from X11 and the font sizes are based on the gnome
   dpi.

 - Non Gnome-Applications use the X11 value for both font rendering
   and calculation of physical sizes.

 - Applications like Gimp and Adobe Acrobat allow manual specification
   of the dpi, because both X11 and gnome dpi are notoriously
   unreliable in value and meaning.

 - Applications like Mathematica effectively rely on the gnome dpi
   value to be fixed at 96dpi (otherwise the fonts get ridiculously
   large).

   
Personally, I think the following policy would best resolve the mess:

 - The X11 dpi should correspond to the physical monitor dimensions.
   In order to ensure this, the "Screen Resolution" preferences dialog
   should also allow to specify the size of the monitor.
 
 - The gnome dpi should be renamed to "font magnification" and be
   given as a percentage of the X11 dpi.

 - All font rendering should be done using the x11 dpi scaled by the
   magnification factor.

 - All physical sizes (e.g. "how many pixels do I have to use to show
   something as 10x10cm?) should be calculated based on the X11 dpi.
   

This

 - fixes the meaning of the different values.
 
 - makes the difference between them more apparent by exposing both
   values to the user and giving them meaningful names.
   

   
I hope that it will be possible to either find a better solution or to
get a general agreement on the above one. This will hopefully be
enough to remove the confusion around the dpi handling that apparently
prevents the related bugs from being fixed.



Best,


   -Nikolaus

-- 
 »It is not worth an intelligent man's time to be in the majority.
  By definition, there are already enough people to do that.«
                                                         -J.H. Hardy

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C




More information about the ubuntu-desktop mailing list