Xorg.conf configuration — solved font size problem

Awhile ago I started having problems with some of my fonts on my computer at work. Interestingly enough, it only seemed to affect a very small minority of programs and situations, namely on startup, when Fedora is going through and telling me all the services it is starting, the fonts were so tiny I could not read them. This also seemed to be the case for Matlab. For Matlab, I temporarily solved the problem by just changing the settings to use really big fonts (like 30 point or so). But today I wanted to run EEGlab, which is a Matlab toolbox to analyze EEG data. The toolbox has a GUI, and the GUI fonts were also tiny. I decided I needed to dig around some more, and I finally fixed the problem. Ultimately it was a misconfiguration in my xorg.conf file, that mysterious file that can cause so many things to go wrong on Linux. I discovered that Fedora uses the /etc/X11/Xresources file to specify the DPI (dots per inch), that your screen should have. It was set at 96 dpi, which seemed correct. And it must be the case that most programs use this value when calculating how to display fonts. However, there is also an option in the Monitor section of xorg.conf called DisplaySize, which is some sort of combination of the display resolution and the DPI. More precisely, the display size should be <pixelsize>/96*25.4. For the 1440×900 monitor I use at work, this turned out to be 381×238. Previously I had it set to 1440 x 900, which was why my fonts were so tiny.
To summarize, my xorg.conf looks like:

# Xorg configuration created by system-config-display

Section "ServerLayout"
  Identifier     "single head configuration"
  Screen      0  "Screen0" 0 0
  InputDevice    "Keyboard0" "CoreKeyboard"

Section "InputDevice"
  Identifier  "Keyboard0"
  Driver      "kbd"
  Option      "XkbModel" "pc105"
  Option      "XkbLayout" "us"

Section "Device"
  Identifier  "Videocard0"
  Driver      "radeon"
Option   "UseEdidDpi"   "FALSE"
        Option         "DPI" "100 x 100"

Section "Monitor"
        Identifier            "Monitor0"
        HorizSync       30.0 - 82.0
        VertRefresh     50.0 - 85.0
        Option          "DPMS"
        Modeline        "1440x900_70.00" 126.98 1440 1536 1688 1936 900 901 904 937 -HSync +Vsync
        Modeline        "1440x900_60.00" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
        #DisplaySize     1440 900
        DisplaySize     381 238

Section "Screen"
        Identifier            "Screen0"
        Device        "VideoCard0"
        Monitor         "Monitor0"
        DefaultDepth    24
       SubSection            "Display"
        Depth           24
        Modes           "1440x900_70.00" "1440x900_60.00"

Now I am very happy about my working fonts!

This entry was posted in linux. Bookmark the permalink.

Comments are closed.