Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 07-15-2007, 08:28 PM   #1
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Rep: Reputation: 33
Debian font size strange behaviour

Hello Linux folk

I have two similar PCs with the same Debian 4 (Etch) with non-free NVIDIA driver installed on each, and running KDE. Both have size 11 San Seriff font, and identical unforced DPI (dots-per-inch) resolution setting.

One looks crisp, and the fonts are reasonable, even for my eyes, while the other has them tiny, minute little things.

One clue may be that when I use Log out --> End current session, on the tiny fonts PC, and then do a console login, and then do "startx", the resulting screen suddenly changes to nice fonts the same as the first PC, BUT ..., opening the Konsole terminal then delivers huge fat black letters.

Getting fonts right in installations is not easy. They all will do something different. Whether its the fonts in applications like Iceweasel, or in menus, whatever. I could use a little help in knowing where to look to resolve this one, so that the standard graphical login works, and we don't have to ask for fonts size 15.

Old 07-16-2007, 02:14 PM   #2
Senior Member
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,064
Blog Entries: 8

Rep: Reputation: 310Reputation: 310Reputation: 310Reputation: 310
I vaguely remember having that sort of problem before. What I think is going on is that there are two places where the dpi setting are being defined--one is in /etc/gdm.conf, which will only be "activated" if gdm is running (it will be skipped with "startx"). I'm not sure what the equivalent is with kdm if you're using kdm. Anyway, by default I think gmd.conf has 96dpi set.

The other place where the dpi setting may be defined is indirectly, within /etc/X11/xorg.conf. Here, the monitor may have options for defining the display size in millimeters.

In the past, I got things to work the way I wanted by defining the display size in millimeters in /etc/X11/xorg.conf. But lately, I just leave out that option and am generally satisfied with the default 96dpi. However, I only use CRT monitors which don't send detailed monitor info to the computer. Things might be different with an LCD monitor, which might feed the computer funny data. In particular, 72dpi is a common standard. It actually makes a LOT more sense than the Windows-default of 96dpi. With the Mac-style 72dpi standard, the size of a font equals the height in pixels, meaning you can specify any desired line spacing with pixel precision. With Windows-style 96dpi, each font point is equivalent to 4/3 pixels, meaning not every pixel height is available.

With 72dpi, a 12 point font will only be 12 pixels tall. With 96dpi, a 12 point font will be 16 pixels tall.

Anyway, assuming you're using gdm, post your /etc/gdm.conf, and /etc/X11/xorg.conf files. Also, some information about the monitors may be necessary.
Old 07-16-2007, 04:03 PM   #3
Registered: Apr 2004
Location: NJ,US
Distribution: Debian Sid
Posts: 33

Rep: Reputation: 15
If you use kdm, you can set the dpi in /etc/kde3/kdm/kdmrc
Edit the "ServerArgsLocal" line by adding "-dpi 96" to start x with a dpi of 96.
Old 07-17-2007, 12:51 PM   #4
Registered: Dec 2006
Posts: 37

Rep: Reputation: 17
nVidia graphics card

If you are using an nVidia graphics card you can set the DPI with some options in the drivers section.

The tag for setting DPI in standard Xorg server:

->Section "Monitor"
DisplaySize <width> <height>

then use

$ xdpyinfo |grep resolution

to see what it set and adjust.

You can also grep the /var/log/Xorg.0.log or whatever for the assigned display size.
Old 07-20-2007, 05:00 PM   #5
Registered: Oct 2005
Location: UK
Distribution: Mint
Posts: 214

Original Poster
Rep: Reputation: 33
My thanks to all of you. I now have quite nice fonts setup. During this little struggle with fonts, we have learned that fonts are affected, and can be controlled from many places.

1. The X settings that affect DPI are the most fundamental, and scale the size of everything, fonts included. /etc/X11/xorg.conf can be given sets of definitions for monitor profiles, and within those, set of definitions for exactly how the video will be clocked out for various standard display resolutions. You go here at your peril. Usually, when you install your distro, this is where you set the highest, and various other lower resolutions your GUI can have available. There are very detailed descriptions on how to turn a xorg.conf.example into what suits you in the excellent Gentoo documentation, (even if we don't use Gentoo!), and of course from

2. At the next level, how the display manager (kdm, xdm, whatever), deals with fonts and DPI is more selective. With KDE, if one uses the Menu -> Control Center -> Appearance and Themes -> Fonts route, then there is the opportunity to select "Force fonts DPI" to be 96 or 120. it requires a complete logout, and re-login for the effect to reach everywhere. My apologies that this text is "KDE-centric", but I am sure others can contribute gdm and gconf equivalent descriptions. I know Gnome can grow on one, and has some attractive features, but I never gave it a fair chance (so far!)

3. Then there are the ways a user gets to overide these, and have desktop fonts to his choice. For KDE, in /root, and in every /home/username folder, there is a hidden .kde/share/config/startupconfig shell script, and also a .kde/share/config/startupconfigkeys text file.
The text file has the few lines ..
kcminputrc Mouse cursorTheme ''
kcminputrc Mouse cursorSize ''
kpersonalizerrc General FirstLogin true
ksplashrc KSplash Theme Default
kcmrandrrc Display ApplyOnStartup false
kcmrandrrc [Screen0]
kcmrandrrc [Screen1]
kcmrandrrc [Screen2]
kcmrandrrc [Screen3]
kcmfonts General forceFontDPI 0
The last line seems important, but any attempt to edit it is not permanent, because of the effect of the nearby shell script..
"startupconfig" #! /bin/sh
# kcminputrc Mouse cursorTheme ''
# kcminputrc Mouse cursorSize ''
# kpersonalizerrc General FirstLogin true
# ksplashrc KSplash Theme Default
# kcmrandrrc Display ApplyOnStartup false
# kcmrandrrc [Screen0]
# kcmrandrrc [Screen1]
# kcmrandrrc [Screen2]
# kcmrandrrc [Screen3]
# kcmfonts General forceFontDPI 0
This time, editing the last line does work. It will set the default DPI. In the past, in FireFox preferences, there was a little tool that would present a horizontal line to measure with a ruler, and entering the value, it would calculate the DPI for that screen, and use it. On my 19" CRT monitor, at 1600x1200, the DPI is about 112. In practice, setting the DPI to 96 or 120, and then working on the application's own control of font size as used within them, is a workable approach.

4. Then we come to what happens in applications. After messing with DPI, the chosen fonts in Konsole and similar edit-type applications may need attention. A very common one is the Synaptic package manager. After you have finished tweaking the DPI, and settled for a comfortable font size for the desktop, you can find the fonts in Synaptic very tiny small. From within Synaptic, choose Settings -> Preferences -> Columns and Fonts and tick the box "Use custom application font", and then click the "Application Font" option and fix it up to suit yourself.

5. Iceweasel has two kinds of fonts you will be interested in. One is the whole set of fonts that web pages will use, and the other kind is the font in the toolbars and menu. The web pages fonts is straightforward to meddle with using Iceweasel -> Edit -> Preferences -> Content and then click the "Advanced" button in the "Fonts and Colours" section. Getting the rest of the application fonts to a nice size requires to meddle with the user's .mozilla/firefox/adk36las.default/chrome directory. You use the supplied file userChrome-example.css, and save a copy as userChrome.css. Then edit it by adding the end lines to force your font choice for Toolbars, Menus, etc. thus:-
font-size: 11pt !important;
The asterisk is not a mistake, and not to be confused with asterisks used in many nearby C-style comment lines.
It seems that exactly the same thing can be achieved by simply typing "about:config" into the URL entry line. and then seeking the right line to edit (trying not to get distracted). Right click and choose "Modify". The edited line comes up bold. I tried this, but it did not seem to "stick". Maybe I missed some save step, but anyway, I settled for editing the file directly.

6. Konqueror has three aspects to setting fonts. One is what appears in the Toolbar Menus and related boxes. This it seems to pick up automatically to be the same as was chosen for the desktop. The next is the fonts under the folder icons when Konqueror is being a file manager. This is done with Konqueror -> Settings -> Configure Konqueror -> Appearance. Finally, the group of fonts that will apply to web page contents is further down the list under "Aa Fonts" selection. Even after you have selected them all, Konqueror provides a special separate "Font size adjustment for this encoding" to shift the whole lot larger or smaller at will.

While I am sure that most applications will have some way of tweaking the fonts that may be involved in its display or use, the methods do vary, and can get obscure. While all the above may be just plain obvious to some, it took me quite a while to uncover it all, and may not be the best or slickest setup. I did not elaborate on xorg.conf because I hate the thing. It is easily the file I am most prone to mess up, and the effects can be so catastrophic.

I hope some will find this useful
Old 08-10-2007, 03:20 AM   #6
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 4,038

Rep: Reputation: Disabled
Thank you for the detailed account of the solutions you found .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 11:29 AM
Problems in font size after upgrade to Xorg on Debian bagualdocavera Linux - General 2 10-22-2006 04:49 PM
strange mouse behaviour with logitech pilot mouse in debian 3.0r2 g-string 3 Debian 0 11-12-2004 06:27 AM
strange java font size on X leomekenkamp Linux - Software 1 07-07-2003 03:39 AM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration