DæmonNews: News and views for the BSD community

December 1999 Get BSD New to BSD? Search BSD Submit News FAQ Contact Us Join Us
Search


Get BSD Stuff

Living with Netscape

by Greg Lehey, grog@FreeBSD.org

Sue Blake is busy this month, so I've jumped in to fill her spot.

Those of you who've been following my opinions will know that I don't have many nice things to say about HTML.

HTML stands for Hypertext Markup Language, which is used to write web pages. That's why the names of most web pages end in .html. Because of file naming restrictions, Microsoft users frequently abbreviate this still more to .htm.
It's not powerful enough to really describe the formats that you need for professional page layout, and it's now fragmented due to the browser wars: Netscape and Microsoft both have incompatible extensions.

The worst problem I have with HTML, though, is a conceptual one: it takes the attitude ``The best person to decide how to display a document is the person who's reading it''. When you consider the amount of pain it is to decide on a layout for anything but the most trivial document, this is just plain wrong. In practice, too, it's not what anybody wants. Web designers go to a lot of trouble to give their web pages a special look. People looking at their pages don't want to have to set up their browsers specially to look at every page; in fact, most people don't know how to set them up correctly. I certainly don't know all the answers, and I'm pretty sure that there are no answers for some of the questions.

When Dæmon News first started up, we had long discussions about what the layout should look like. It's changed a lot over the last year and a bit, but I still wasn't happy. Recently we changed the format of the Dæmon News Daily web page. I still wasn't happy. What I was seeing looked something like this:

This image is 640x480 pixels in size. If you're looking at this image on a low-resolution screen, you should be able to read it. I use a 1600x1200 screen, and all that I could see was flyspeck.

OK, I thought, that's what the preferences are for. You select Edit, then Preferences, and under the category Appearance you select Fonts. The resulting screen looks like:

Sorry about the size of this screen, which is not resizable. The important settings are at the top right:

So, the obvious thing is to change the size of the fonts. In this particular instance, I set the size of the fonts to 24 points (the largest, double the default), and turned scaling off. Guess what? It didn't work. The frames became larger, but the tiny text didn't change in size.

At this point, an experienced programmer may decide to go in and look at the code. Oh, that's right, we don't have the source code to Netscape. Well, some of it, but enough to make things painful. Another thing to do is to look at the application defaults file, which X uses to describe various application-specific parameters for X programs. I did that, found the biggest application-defaults file I have ever seen, and came out still confused. There's obviously room for improvement here, but I haven't figured it out yet. If anybody gives me some useful hints, I'll publish them in an update to this article.

Then somebody said ``use 100dpi fonts''. What's that? X installs a number of sets of fonts in the directory hierarchy /usr/X11R6/lib/X11/fonts. Some of them are for special purposes (for example, Cyrillic and Chinese fonts), but there are two general purpose fonts sets, 75dpi and 100dpi. Like the concept of point size, the idea here was that most monitors have a dot pitch of between 75dpi and 100dpi (dots per inch). In fact, monitor pitches are measured in millimetres even in the USA, so it's good to know that 75dpi corresponds to 0.34 mm, and 100dpi corresponds to 0.25 mm. Most modern monitors have dot pitches between 0.23 and 0.29 mm, so the 100 dpi fonts are more appropriate.

So how do you tell the X server to use 100dpi? In the X server configuration file /etc/XF86Config, you'll find the following lines close to the top:

    FontPath	"/usr/X11R6/lib/X11/fonts/misc/"
    FontPath	"/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath	"/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath	"/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath	"/usr/X11R6/lib/X11/fonts/100dpi/"

These lines define a search path like the PATH environment variable that your shell uses to find executable programs. The way the file is set up, the server will find the fonts in the 75dpi directory if they're there. To make it search the 100dpi fonts first, change the order of the lines:

    FontPath	"/usr/X11R6/lib/X11/fonts/misc/"
    FontPath	"/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath	"/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath	"/usr/X11R6/lib/X11/fonts/100dpi/"
    FontPath	"/usr/X11R6/lib/X11/fonts/75dpi/"

You'll have to be root to do this, since XF86Config belongs to root. That's all there is to it! Well, you need to stop your X server and restart it. When you do, you should see something like this:

Adding other fonts

While we're looking at this file, this is also the place where you would add other fonts, for example Russian or Chinese fonts.

All's well that ends well?

Now I can read web pages that I couldn't read before. Am I satisfied? Not really. It's still too difficult to set up text sizes so that you can read everything comfortably. Consider the following image, from the eBay auctioneers:

I've deliberately made the image as small as possible, but the size of the text comes from eBay, and somehow they've managed to make it as tiny as before; probably they have specified a font that I don't have in 100 dpi.

As if that wasn't bad enough, compare it with text from elsewhere on the same web site:

As I said at the beginning, this is a basic problem with HTML: it's designed for the user to determine the sizes and layout, but that's not the way it's used. Each web author decides for himself how big things should be, and in the process he makes assumptions about the hardware you're using. He's bound to be wrong a lot of the time.




Author maintains all copyrights on this article.
Images and layout Copyright © 1998-2004 Dæmon News. All Rights Reserved.