Trace: Fonts

Fonts

Fonts

To install a new font globally just:

  1. Create a directory for it under /usr/share/fonts.
  2. Copy the OTF or TTF files into that directory (OTF being the newer and preferred format, having more capabilities).
  3. Regenerate the font cache with the fc-cache command.

For example, to install the open source Playfair Display font, which is not in Gentoo's portage but is available on github, I first went to https://github.com/clauseggers/Playfair-Display and grabbed the link from the Clone and Download button, then downloaded the source with Subversion1), installed the OTF files and regenerated the font cache like so:

su                                           ← Use whatever method you prefer to become root.
cd /tmp
svn co https://github.com/clauseggers/Playfair-Display.git
mkdir /usr/share/fonts/Playfair-Display
find Playfair-Display -name "*.otf"          ← This showed me the OTF fonts' directory.
cp -av Playfair-Display.git/trunk/fonts/CFF/* /usr/share/fonts/Playfair-Display
fc-cache -fv

To install a new font locally (for just my user) I could have put the files into ~/.local/share/fonts instead, e.g., as my non-root user I could:

mkdir -p ~/.local/share/fonts/Playfair-Display
cd /tmp
svn co https://github.com/clauseggers/Playfair-Display.git
cp -av Playfair-Display.git/trunk/fonts/CFF/* ~/local/share/fonts/Playfair-Display/
fc-cache -fv

References

1)
Of course, I would recommend using git unless you are a long-time Subversion user like me.