Install fonts on linux

If you have binary encoded Type1 fonts (a .pfb and a .pfm file) here is how to create the afm files for then:

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-glyphsfrom 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

Install to ./fonts or /usr/share/fonts/…

This will give you the core fonts, but if there are other TrueType fonts that you want installed, it is as easy as copying the font files to the ~/.fonts/ directory.

After installing new fonts, you will have to log out and log in again to be able to see and use the new fonts. If you want to avoid this, you can regenerate the fonts cache by issuing the following command:

 $sudo fc-cache -fv