Present Location: News >> Blog >> X11, fonts, and DPI

Blog

> X11, fonts, and DPI
Posted by prox, from Charlotte, on May 18, 2007 at 23:21 local (server) time

Ever wonder why sometimes, out of the blue, fonts in GTK/Qt applications become huge?  Yep, me too.

The answer (most of the time) has to do with the DPI your X11 video driver assigns the particular display.  Normally, the DPI setting is derived from the physical dimensions of the particular screen in use.  This is an attempt for fonts, and other screen elements, to be sized correctly.

It seems that some drivers do this correctly, and some don't.  The fglrx driver is way off, most of the time.

Here is a dialog with normal-sized fonts (DPI of 104 x 98):

Normal Fonts

Here's one with huge fonts (DPI of 127x127):

Huge Fonts

A quick way to determine the current DPI is to run the following:

lepton% dxpyinfo|grep dots
  resolution:    104x98 dots per inch

One of the fixes is to override the display dimensions in your xorg.conf, and ignore any EDID information from the physical display.  Example from xorg.conf:

Section "Monitor"
     Identifier     "LCD Panel"
     # Set Display Size
     DisplaySize    340 270
EndSection

The 340 x 270 mm size seems to work for me (even though it's not the physical dimensions of my monitor), and sets the DPI to 104 x 98.

Here's some output from Xorg.0.log after X is restarted with the DisplaySize directive:

(**) fglrx(0): Display dimensions: (340, 270) mm
(WW) fglrx(0): Probed monitor is 280x210 mm, using Displaysize 340x270 mm
(**) fglrx(0): DPI set to (104, 98)
(--) fglrx(0): Virtual size is 1400x1050 (pitch 1408)

Yeah, it's WW'ing since the DisplaySize has been overridden.  This is fine.

> Add Comment

New comments are currently disabled for this entry.