DæmonNews: News and views for the BSD community

Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

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:

  • The Encoding tells Netscape what character codes to use. Normally ISO 8859-1 is fine, but if you live in a country which doesn't use a Roman alphabet, you may want to change this field.
  • The Variable Width Font is the one used for displaying the text such as this. You have a number of choices which alter the appearance more than anything else.
  • The Size is specified in points, which are nominally 1/72 inch or 0.353 mm. On a screen, the real size depends on what kind of X fonts you use (more about that later) and the size of your screen, so it's an approximation at the best. You should expect, though, that if you double the size specification here, the text on your screen should be double the size.
  • Scaling appears to be intended to determine whether Netscape changes the size of the text depending on hints in the HTML source: authors can put in tags like <font size=1>, which tells the browser to make the text as small as possible, or <font size=y>, which tells the browser to make the text as big as possible. This doesn't seem to work, and Netscape's manual doesn't help. It seems best to leave it turned off.
  • There's also a field for entering a size. Again, the manual doesn't give any clear indications what it is for, and anything I have ever typed in there has disappeared without trace.
  • The Fixed Width Font is used for displaying text like this, which is often used for displaying things like program output. This is entirely up to the author of the web pages, and authors use it for different purposes.

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.

Google
Web daemonnews.org

More Articles
  • Interview with Jan Schaumann
  • Interview with Theo de Raadt
  • Book Review: Virtualization with VMware ESX Server
  • Editorial: Not Quite Dead Yet
  • The Design of OpenBGPd
  • Interview with der Mouse
  • Letter to Steve Jobs
  • Interview with Manuel Bouyer on Xen
  • Apple and Open Source
  • BSDCan 2006
  • BSD Certification Survey Results
  • Lab in a Box
  • Ike Notes on BSDCan 2005
  • BSDCan 2005 Photos
  • FreeBSD Developer Summit Pictures

  • Advertisements




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