Montag, 8. Oktober 2007

Installing Type1 fonts for OpenOffice

My wife has a binary encoded Type1 font (a .pfb and a .pfm file) that contains symbols for guitar tab notation. It came with some Windows software, and obviously in Windows the .pfb file and .pfm file are enough to use the font.

Right clicking the .pfb file in KDE let's you install the font, but it doesn't show up in OpenOffice's font selector. KWord on the other hand let's you use it.

After some googling I found out that OpenOffice in Linux needs an accompanying .afm file, and here's how to create the .afm file from the .pfb file:

  • Install t1lib, a library for generating character- and string-glyphs from Adobe Type 1 fonts: sudo apt-get install t1lib-bin

  • Go to the directory where the .pfb file was installed, e.g.: cd ~/.fonts

  • Create the .afm file, e.g.: type1afm fontfile.pfb

And that's all, starting OpenOffice should now show the font in the font selector.

Alternatively, the .afm file can go to a subdirectory named afm.