Tuesday, June 23, 2009

Tiny fonts with xorg (incorrect DPI)

Lots of monitors are totally screwed up in the way they report their sizes to your video card. So it's quite common to have insanely large or insanely tiny fonts for some graphical apps in linux.

Here's how I just fixed that on an Ubuntu Linux machine:

As root, edit /etc/X11/xorg.conf. In the "Section "Device"" part of the file that has your video card settings, put this so it won't try to get the DPI from the monitor:

Option "UseEdidDpi" "off"

Then, in the "Section "Monitor"", I added this line:

DisplaySize 508 286

That makes my 1920x1080 display use 96x96 dpi, a good common value.

This thread in the Arch linux forums lists this formula for the DisplaySize: displaysize = (/DPI-Desired)*25.4. So (1920/96)*25.4 = 508.

Save the file, restart X with control-alt-backspace, and see if it works.

2 comments:

Anonymous said...

This worked perfectly on my large 1080p television set, Ubuntu 8.10.

Anonymous said...

Still works perfectly in 11.04, also on a 1080p TV.