Updated 17 Dec 02001.

Installing New Fonts in Solaris StarOffice 5.1

Struck by the lack of useful documentation on how to do this successfully, I wrote this for a Sun installation of my acquaintance. This is provided in the hope of being useful, seemed to work for me, but your litreage/100km may vary. It may work for other ports of StarOffice, but hasn't been tested extensively.

StarOffice 5.2 seems to have fixed its font install routine. It still requires extreme care to install fonts, though, and test your installation thoroughly.

StarOffice comes with a pretty graphical tool for installing new fonts which almost works correctly. Here is a method for correcting the installation technique.

Throughout this guide I will refer to directories relative to the top level of installation. On this system it's /opt/Office51, so when I mention the xp3 directory I'm really referring to /opt/Office51/xp3; yours may be different.

Font Requirements

I have only had success with real Type 1 fonts; converted TrueType [however one might try to do it] fonts don't seem to work. For each font, you will need:

The file names should match, differing only by the afm or pfb extension. Even if you have everything in order, this method may not work, and you may have to remove the fonts. Semibold and demi fonts may not appear to work, as StarOffice has only one level of boldness.


  1. Copy the font files to the directory fonts/type1, creating it if necessary.
  2. Make backups of any existing fonts/type1/fonts.dir, fonts/type1/PSres.upr, and xp3/psstd.fonts
  3. Start the printer administration utility bin/spadmin
  4. Select Add Fonts, and set the browse directory to fonts/type1. Select Okay and accept the list of fonts to install.
  5. In the font properties window, select Convert All Metric Files, then select Close. Exit the spadmin program.

What the above will have done is:

Fixing fonts/type1/fonts.dir

You'll need some familiarity with X Logical Font Descriptors (XLFD), X's way of describing font information. The main problem with StarOffice's install routine is that it confuses the font foundry with the font name if the font name has a space in it. All of these font files appear with a foundry of misc and a font name of foundry font. Very few fonts (and no commercial ones) should have a foundry of misc, so the incorrect lines are easy to spot.

For example, for ITC Stone Sans, the install routine gives the line:

ss______.pfb -misc-itc stone sans-medium-r-normal--0-0-0-0-p-0-iso8859-1

where it should read:

ss______.pfb -itc-stone sans-medium-r-normal--0-0-0-0-p-0-iso8859-1

You can find the foundry from reading the afm file.

Most (Roman) fonts should have an XLFD ending -iso8859-1. If the file contains entries ending -iso8859, it's probably stuck an extra medium entry in the line. XLFDs should all have the same number of dash-separated fields. Non-alphabetic fonts (like pi or phonetic fonts) should have an XLFD ending with -adobe-fontspecific

Most fonts are proportional, and should have the the fourth-last field as p. With mono-spaced fonts it should be m

Semibold fonts will have the weight wrongly set to medium or bold. It should be semibold, but StarOffice doesn't seem to know/care about these.

Sometimes, the install routine just plain forgets about some mebers of a font family. Check that there's an entry for every pfb you copied.

Lastly, the first line of the fonts/type1/fonts.dir file should be the number of font lines in the file. This is easily worked out with the command wc -l fonts/type1/fonts.dir and subtracting one from the printed result. The file should have no blank lines in it, and each line should be unique.

Fixing xp3/psstd.fonts

Thankfully this file has a very similar format to fonts/type1/fonts.dir, so I'd recommend the following technique:

  1. Delete the lines pertaining to the fonts you've just installed.
  2. Copy the relevant lines from fonts/type1/fonts.dir
  3. In these replacement lines:

For example, the line in fonts/type1/fonts.dir:

ss______.pfb -itc-stone sans-medium-r-normal--0-0-0-0-p-0-iso8859-1

should appear in xp3/psstd.fonts as:

ss______, -itc-stone sans-medium-r-normal--%d-%d-%d-%d-p-0-iso8859-1

Testing the installation

Make sure that StarOffice can both display and print the installed fonts correctly. If not, it would be wise to remove them, as it's better not to offer a feature than to offer it and it not work.

Removing fonts is relatively simple; just delete the offending lines from fonts/type1/fonts.dir and xp3/psstd.fonts. You will also have to edit fonts/type1/PSres.upr, which is more complex; it links file name with font families and display styles. Removing whole families from this file is easy; individual entries are more difficult. The only recommendation I can give is that the file must end with a period on a line of its own; otherwise, none of the PostScript fonts will display or print correctly.


Stewart C. Russell, Kirkintilloch, Scotland