Wednesday, January 12, 2011

Ubuntu: Installing Fonts

It's very easy to install fonts in Ubuntu. Fonts usually come in a zip file. There may be several different versions of the same font with different extensions. I've currently tried this with ttf and otf fonts.

System-wide fonts are located at /usr/share/fonts. However, I prefer to keep things to myself, so I will install it in my home directory.

Create a .fonts directory in your home if it doesn't exist already.
mkdir ~/.fonts

Extract your font to the .fonts directory. You only need to extract one of the font versions. For example, if the zip file contains both myfont.ttf and myfont.otf, you only need to pick one of them, like myfont.ttf.

Refresh the font cache.
sudo fc-cache -f -v

If you had an application open, now would be a great time to restart it. You should now see the new font.