Font Handling in Solaris Netscape
For some time I've been frustrated that fonts didn't come out in the proper size and style in Netscape under Solaris. Pages that look fine at home under Windows would be decidedly substandard on my Sun at Rutgers. I've now figured out a number of tricks to get font handling to work properly.
Matching Font Sizes
First, if you are running Solaris 2.6, you must install patch 105633-05 or later. Otherwise all bets are off. Fonts may fail to display entirely. That is, you may end up with part of your web page completely blank.
Choosing a Default Font
The next problem to solve is synchronizing font sizes. I like large fonts. (As you get older, you'll understand.) I went into the preferences menu and picked a nice, large size. This worked fine for text displayed using the default font. But when a web page specified an alternate font, the font came out too small. Since many web pages are using a sans serif font for headings, the result was that the titles and headings looked smaller than the text. Very odd.
This line is set with three fonts: This sentence is set in your default. This sentence is set in Arial or Helvetica. This sentence is set in Times. All three should be roughly the same size, although Arial and Helvetica naturally tend to be slightly bigger than other fonts. If the Arial/Helvetica or Times sentences are noticably small, you've got this problem.
Here's what is going on: The size you set in the preferences menu applies only to the font that you set in the preferences menu. All other fonts are displayed in a size that you can't change.
Suppose you go into the preferences menu, and choose 20 points. Normal text will now change to 20 points. But anything where the page designer has asked for a different font will still be in the builtin size, which may be too small.
However there's a way around this. There are two variables you can set in your .Xdefaults that will magnify all fonts, both the one you choose in the preferences menu and all others. These variables are intended to let you choose 75 or 100 dpi fonts. By default, it uses 75 dpi. By setting it to 100, you can get larger fonts. For many people, this may be large enough. To do this, put the following lines in your .Xdefaults:
If this doesn't give you large enough fonts, you can use larger values. However if you use a size other than 75 or 100, some fonts may look slightly odd.
Unfortunately this still isn't a complete solution: The Solaris version of Netscape does not handle <font size=..> properly. It doesn't show large sizes large enough. Normally you don't care. But the Rutgers format involves a banner at the top of the page that looks really silly if it isn't large. When I do web pages I specify the size using a STYLE property. That seems to work properly. I also include the SIZE property, for older browsers that don't understand style sheets. Here's an example:<font size="6" style="font-size: 22pt">
You should give some thought to what you use as your default font. Type 1 (Postscript) fonts are handled by code written by Adobe. I'm fairly impressed with the quality of the rasterizer. However it is limited by the fact that it doesn't do anti-aliasing. It appears that the X display model doesn't permit that. (Note that Adobe Acrobat does its own rasterizing. It does include anti-aliasing. Thus a PDF/Acrobat document will generally look better than the same document displayed with the same font in Netscape.)Additional Fonts
Unfortunately there are a number of different kinds of fonts in Solaris. These include:
The Type 1 and Truetype font technologies are essentially the same for both Macs and PC's. However the actual binary formats are different. It appears that Solaris uses the PC versions.
- Type 1. This is the font format used by Postscript printers.
- Type 3. An old Postscript format, which is not currently used for much.
- F3. This is a new font format originally intended to replace Type 1. It and the code to support it are very fine. Unfortunately this format hasn't gone anywhere. Sun has announced that they are killing the format. There aren't very many fonts available in F3 format, though Solaris comes with a few nice ones.
- Speedo. This is an old Bitstream format, which is supported by the MIT code. I don't believe any new fonts are being done in Speedo. It is used for Bitstream Courier and Charter. I can't tell the quality, since Courier is hard to judge, and the copy of Charter that comes with 2.6 is unusable.
- Truetype. This is a joint Apple/Microsoft format, which is used for both Macs and Windows. Sun isn't shipping any Truetype fonts. But for people with PC's, Truetype fonts are probably the easiest to find. You may want to look at the free web fonts at http://www.microsoft.com/typography. Note that the Truetype font directory isn't in the font path by default, so you'll need the appropriate xset command in your startup file.
- Bitmap formats. Most of the traditional X fonts are bitmaps.
If you want to get the correct font sizes, you should choose an F3 or Type 1 font, since those are scalable. If you use a bitmap font with scaling on, the results are likely to be terrible. With scaling off, you are likely to miss some font size changes unless the font you have chosen has a very large number of sizes available.
I've tried most of the scalable fonts. I think Linotype New Century Schoolbook is the best of the lot, with Bookman and Lucida Bright as reasonable alternatives. For non-scalable fonts I prefer Adobe New Century Schoolbook.
You might also want to try Georgia. This was designed specifically as a web font. However to use it, you'll have to install the file in the Truetype area and then do
xset fp+ /usr/openwin/lib/X11/fonts/TrueType/
in your startup file to add the Truetype directory.
The font I'm using is Charter, but it's a Type 1 version of Charter that I've installed myself. Installing a Type 1 font into the Sun X server is a real trip. It requires the following steps:
The latter step is unique to Solaris. If you don't do it, you'll get an error message on the console the first time you try to use the new font, and you'll see Courier instead.
- Put the .pfa file in /usr/openwin/lib/X11/fonts/Type1
- Put the .afm file in /usr/openwin/lib/X11/fonts/Type1/afm
- Edit fonts.alias and fonts.scale in /usr/openwin/lib/X11/fonts/Type1
- Edit DPS13Fonts.upr in /usr/openwin/lib/X11
Finally, some comments about the preferences dialog itself. When you choose a default font, you have several choices: the font name, a menu of sizes, a checkbox for "allow scaling", and a box where you can type a size. For non-scalable fonts you will want to choose a size from the menu. For scalable fonts you will want to choose the size "0" or "any" from the menu, check "allow scaling", and type the size into the box.
Unfortunately it doesn't seem to save the size in your preferences file, if you've typed it in the box. (It does save sizes you choose using the menu.) If you need to use a size other than the default, you'll have to do some hackery: edit ~/.netscape/preferences.js, look for the font name you have chosen, and replace 0 with the font size multipled by 10. For example, I use 13 point Charter. In preferences.js, there was a line
user_pref("intl.font_spec_list", "schu ... free-charter-0-scale-prop-iso-8859-1,"); I replaced the 0 with 130, i.e. 13 points. To prevent Netscape from putting a zero back into the file next time it tried to update the preferences, I protected the file 444, i.e. read-only.
I have a small collection of additional fonts on /rutgers/ref. This includes a Type 1 version of Charter, and all of the free Truetype fonts on the Microsoft web page. (You can't just go to www.microsoft.com and get them. Microsoft distributes them with an installation program for Windows. So I had to get them, install them on a PC, and then move the fonts over to Unix.)
These fonts are available as /rutgers/ref/ru-dist/ru-config.2.6/extrafonts.tar
A couple of caveats:
- The tar file includes new copies of /usr/openwin/lib/X11/DPS13Fonts.upr and fonts.dir and fonts.scale from /usr/openwin/lib/X11/fonts/Type1 and /usr/openwin/lib/X11/fonts/TrueType. If you have installed type 1 or Truetype fonts other than what comes with Solaris, you'll need to merge your changes with mine. (Note also that they are from 2.6. They may not be appropriate for other versions of Solaris.)
- To use the Truetype fonts, you'll need to make sure that /usr/openwin/lib/X11/fonts/TrueType is in your font path.
- fonts.dir in the Truetype area does not include Arial, although the actual Arial fonts are there. I found that Helvetica looks significantly better than Arial. Most web page that use Arial actually specify "Arial,Helvetica". That is, if Arial isn't found, they ask for Helvetica. That you're actually better off not to have Arial. If you need Arial for some reason, you just need to add the entries in fonts.dir
- I have modified the bounding box in the Charter font definition. The original version had too much interline-spacing. This shouldn't cause any trouble, but I thought I should warn you that you're not getting an unmodified font.
For more information, contact
Last updated: Tuesday, 06-Apr-1999 11:29:19 EDT
© 1999 Rutgers, The State University of New Jersey. All rights reserved.