Free-Conversant Logo
SoftEdges

DPI (Dots Per Inch) -- 100 vs. 75



Subject DPI (Dots Per Inch) -- 100 vs. 75
Posted 6/25/2003; 12:12 PM by Ed Hurst
Last Modified 6/25/2003; 12:13 PM by Ed Hurst
In Response To (#Top of Thread.)
Label None. Read 1149
<<PREVIOUS NEXT>> TOP THREAD EDIT REPLY
.

DPI (Dots Per Inch) -- 100dpi versus 75dpi

If you use a screen resolution greater than 800x600 in Linux with most monitors, you will have a slightly fuzzy display, in spite of anti-aliasing (AA). Why it is that it seems every distro of Linux defaults to 75dpi has yet to be explained, but SuSE is no different. A higher number dpi simply means more pixel dots per square inch of screen space for a finer-grained font rendering. Here's how to fix that.

First, install the 100dpi fonts package from your version of SuSE. The process of installing seems to make several changes in the system so that it becomes an option. Make sure that the 100dpi fonts are listed first in order before the 75dpi fonts in these files:

   /etc/X11/XF86Config
   /usr/X11R6/lib/X11/XftConfig
   /etc/fonts/fonts.conf

(More on that last item in the Font Fight HOWTO.)

Next, be ready to fix the display parameters for every application that does not use AA. For example, every application that uses Motif or Lesstif libraries must have comments in your ~/.Xresources file to correct the display. It's quite complicated, and you'll have to read up on how to make changes for your specific favorites, but here's an example of what I did for Nedit:

nedit*fontList: -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*
nedit*helpFont: -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*
nedit*boldHelpFont: -adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*
nedit*italicHelpFont: -adobe-helvetica-medium-i-normal-*-12-*-*-*-*-*-*
nedit*fixedHelpFont: -abode-courier-medium-r-normal-*-12-*-*-*-*-*-*
nedit*boldFixedHelpFont: -adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*
nedit*italicFixedHelpFont: -adobe-courier-medium-i-normal-*-12-*-*-*-*-*-*
nedit*h1HelpFont: -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*
nedit*h2HelpFont: -adobe-helvetica-medium-i-normal-*-12-*-*-*-*-*-*
nedit*h3HelpFont: -adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*
nedit*helpLinkFont: -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*
nedit*XmList.fontList: -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*
nedit*XmText.fontList: -adobe-courier-medium-i-normal-*-12-*-*-*-*-*-*
nedit*FileSelect*XmList.fontList: -adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*
nedit*XmTextField.fontList: -adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*
nedit*statsForm*fontList:  -adobe-helvetica-medium-r-normal-*-12-*-*-*-*-*-*

I couldn't get TrueType fonts to work, but the format for naming the font preference is the standard for X. In brief, look in the fonts.dir file wherever your chosen font resides, and you'll see a list of fonts that resemble that format. The asterisks between the hyphens simply allows the system to choose those parameters. If you really want to know more about this, you'll have to look it up. The proper search term is "xlfd" or you can try: "Fonts Naming Convention: XLFD" or see this chart.

If you use Mozilla or Netscape 7.x in the tarball or auto-download version from the FTP site, it uses the older GTK libs. To fix the display for anything in GTK1.x applications, edit your ~/.gtkrc so that somewhere in the file, you have and entry like this:

style "default"
{
        font = "-monotype-arial-normal-r-normal--12-*-*-*-*-*-*-*"

This is usually at the head of a section of default colors, and is probably commented out by default. You can choose any font using the standard notation format as shown. Don't have a .gtkrc? Copy one from your favorite GTK1 theme (I use Blue-n-Gray) and edit the appropriate line.

You may run into other applications which pop up with huge fonts, and will have to trace it down. Google is your friend! You can also ask me, but I'm hardly a real hacker; I just know how to fix stuff I've researched myself.

Next, you have to tell X to use 100dpi as standard. In SuSE 8.2, which defaults to KDM for GUI login, the file that controls it is: /opt/kde3/share/config/kdm/Xservers. Edit it so that the one line that matters has the 100dpi parameter added. Mine looks like this:

:0 local@tty1 /usr/X11R6/bin/X :0 vt07 -dpi 100

If you are using some other login manager, you'll have to find out for yourself which Xservers file (there are several) controls you login, and sets the display to 100dpi.

After all this, you need to restart KDM so that it reloads the new instructions:

rcxdm restart

plus you need to logout and log back in to restart your X session.

Both KDE and Gnome2 are able to adjust the display for 100dpi, and you shouldn't notice any changes. However, please note that, as far as I can determine, none of your Gnome2 display settings work for Gnome2 applications unless you are running Gnome. You'll get the default Gnome2 display settings when you are in any other desktop or window manager.

By Ed Hurst, 25 June 2003
This document released into the Public Domain.

.
<<PREVIOUS NEXT>> TOP THREAD EDIT REPLY
ENCLOSURES

None.
REPLIES

None.





This site managed with Conversant, © Copyright 2010 Macrobyte Resources

Site Managed with Conversant