by Billy Biggs <vektor@dumbterm.net>, Sun Dec 5 2004
Linux applications use the DPI reported by the X server when converting from font point size to pixels. "Sans 10" will be a smaller number of pixels if your X server is configured at 75 DPI than if it is at 100 DPI.
The DPI of the X server is determined in the following manner:
You can check what DPI your X server is set to by running xdpyinfo | grep resolution in a terminal window.
For traditional fonts on X, the DPI was chosen as either 75 or 100 depending on which set of fonts was listed first in your X font path.
Xft/fontconfig added a new DPI parameter as an X resource (Xft.dpi). If set, this value is used by both Qt 3 and GTK+ 2 when rendering. If it is not set, Xft, GTK+-2 and Qt 3 will all fall back to using the DPI reported by the X display.
GNOME also offers an interface to set the Xft DPI. If "gnome-settings-daemon" is running, this will advertise the DPI value set in the gnome-font-properties dialog to GNOME applications via XSETTINGS, and set the Xft.dpi X resource. Any Qt application started after gnome-settings-daemon is running will use the Xft.dpi value configured by GNOME.
Having a standardized DPI is important for choosing good default font sizes.
Windows machines use the DPI value as a way of globally changing font size. Windows XP defaults to 96 DPI. Changing to large font mode increases the DPI to 120. Users can also specify a custom DPI value. The default application font on Windows is "Tahoma 8".
MacOS X standardizes on 72 DPI, which means that fonts are smaller on the Mac at the same point size as on Windows. The default font on my MacOS X laptop is "Lucida Grande 13".
GTK+ uses a default application font of "Sans 10". This size seems to be chosen assuming a screen configured to 96 DPI.
The DPI used on a Linux desktop is defined by the following:
In one weekend supporting tvtime and Eclipse on IRC, I saw the following DPI values from various users, all of whom were using the default X setup from their distribution: 75x75, 85x80, 100x100, 117x115, and 133x133.
I strongly believe that fonts on Linux should pick a standard default DPI value, and thereby standardize the pixel sizes of fonts on Linux desktops. Applications and desktop systems cannot reliably choose default font sizes without this. My proposal is that we standardize this value in Xft.dpi so that it does not affect the DPI reported by the X server for applications which may find this information useful.
The proposal is as follows:
Here is the code for inclusion in the Xresources file:
Xft.dpi: 96.0
There are conflicting ideas about whether screen DPI is useful or not. Configuring Xft to use the default value of 96.0 is much less controversial, as it only applies to fonts.
An obvious criticism of this proposal is that it is proposing a single and arbitrary DPI, which seems to go against the whole concept of "dots per inch". Having a DPI value calculated based on the monitor size is appealing.
The reasons why I believe a fixed DPI is a good idea are as follows: