Fonts (Ubuntu)

This page provides needed information about installing and handling fonts on Ubuntu.

Fonts are an important part of your GUI. You got many possibilities to influence the font-rendering behavior and therefore how text is displayed. But you need to know some things about it, otherwise your resulting typeface may gets unergonomic and bad-looking. Therefore you may have a look at ”Typeface tuning (Ubuntu)”, too.

Terms and formats

TrueType

TrueType is Ubuntu's default font format (like on MS Windows and Mac OS), originally developed by Apple. TrueType font files got a *.ttf extension. The format is the predecessor of OpenType.

On Ubuntu, system-wide TrueTypes fonts are located at /usr/share/fonts/truetype/.

OpenType

OpenType is a cross-platform font format. OpenType is based on TrueType and developed by Adobe and Microsoft. You may look at TrueType as a subset of OpenType. There are two types of OpenType fonts:

  • TrueType based OpenType fonts with *.ttf extension. On Ubuntu, system-wide TrueType based OpenType fonts (→ *.ttf extension) are located at /usr/share/fonts/truetype/ (same dir as TrueType fonts).
  • PostScript based OpenType fonts with *.otf extension. On Ubuntu, system-wide TrueType based OpenType fonts (→ *.otf extension) are located at /usr/share/fonts/truetype/ (same dir as PostScript Type 1 fonts).

PostScript Type 1

PostScript Type 1 is an older font format with some disadvantages regarding hinting (compared with TrueType and OpenType). In difference to TrueType and OpenType fonts, a PostScript Type 1 consist of more than one file:

  • *.pfb – Printer Font Binary
  • *.pfm – Printer Font Metrics file
  • *.afm – Adobe Font Metric file
  • *.inf – Additional meta information (optional)

On Ubuntu, system-wide PostScript Type 1 fonts are located at /usr/share/fonts/type1/.

Installing fonts

A new font will be installed through copying the font file(s) into the needed directory (if the target directory is not already existing, you have to create it first):

Font format system-wide installation installation for a single user account
TrueType/OpenType (*.ttf) /usr/local/share/fonts/truetype ~/.fonts/truetype
PostScript (*.pfm+*.pfb+.afm)/OpenType (*.otf) /usr/local/share/fonts/type1 ~/.fonts/type1

You need root privileges for a system-wide font installation, because /usr/local/share/fonts/ is write-protected for a common user. Use the terminal1) or open the file-manager Nautilus with root privileges2) to create needed dirs and copy the font files via GUI.

To prevent problems, you should open a terminal and run the following commands after installing system wide fonts:

sudo chmod -R +r /usr/share/fonts
sudo chmod -R +r /usr/local/share/fonts
sudo fc-cache

This makes sure that all applications are able to read the font files and rebuilds the system's font cache.

You may noticed, that there is also another font directory: /usr/share/fonts/. The difference between /usr/share/fonts/ and /usr/local/share/fonts/ is that everything below /usr/local/ is not influenced by the package manager. This is important to know, because some often needed fonts are available as normal packages. If you install such a font-package, it should copy the files into /usr/share/fonts/. So don't get confused if you don't see any new files in /usr/local/share/fonts/ after installing fonts using the package manager.

Since Ubuntu 9.10 Karmic (GNOME Desktop), you may also install *.ttf and *.otf font files for the currently logged in user through a simple double click, triggering a preview including an “install” button in the lower right corner. This copies the font into ~/.fonts/.

Troubleshooting

New fonts are not available in my applications

This may be the case right after installation. Reboot your system and it should be fine. If the new fonts still do not appear, check if you installed them correctly and rebuild the system's font cache using:

sudo fc-cache

The wide-spread office suite OpenOffice.org v3.2 brings support for PostScript based OpenType fonts (*.otf). If you are using an older version, you have to use a workaround for OTF fonts in OpenOffice.org.

Applications are crashing since new fonts were installed (e.g. Firefox, segmentation fault...)

All applications need read permissions to system-wide font files. Otherwise they may crash when trying to access them. To make sure everything is able to read the font files, open a terminal and run the following commands:

sudo chmod -R +r /usr/share/fonts
sudo chmod -R +r /usr/local/share/fonts

If the problems are not gone afterwards, they are rooted in something else.

See also

  • Schriften :lang_de: – very good article about fonts and font-rendering
  • WhatTheFont – Seen a font in use and want to know what it is? Submit an image to WhatTheFont to find out.
1) Example: to copy a *.ttf font into the needed directory:
sudo mkdir -p /usr/local/share/fonts/truetype
sudo cp  ~/your/path/to/the/font.ttf /usr/share/fonts/truetype/
2) simply run gksudo nautilus
Print/export
QR Code
QR Code os:ubuntu:fonts (generated for current page)
Languages
Translations of this page: