Installing fonts in your home directory on Fedora

Source: http://tacticalvim.wordpress.com/2010/01/17/installing-fonts-in-your-home-directory-on-fedora-12/

installing fonts in your home directory on Fedora 12

Font installation/usage in Fedora has come a long way over the years, it’s easier than ever to just drop some TrueType fonts onto your system especially if you only care about your personal login being able to use them; on a single user laptop that makes things easier, cleaner and quicker than messing around over in /usr/share/fonts/. (and less prone to forgetting/losing things during an upgrade). This is for a GNOME desktop, KDE may use another method.

Obtain the TTF font(s) you’d like to use; I’ll use the custom Monaco Linux font as an example.

  1. Make a new directory in your home called .fonts (note leading . )
  2. Copy the downloaded TTF file into this directory
  3. Change directory to .fonts (cd ~/.fonts/)
  4. Run the command: mkfontscale (creates fonts.scale)
  5. Run the command: mkfontdir (creates fonts.dir)
  6. Run the command: fc-cache -fv ~/.fonts (rebuilds ~/.fontconfig/)

Given the login name ‘foobar’, it might look like this:

$ cd ~
$ mkdir .fonts
$ cd .fonts
$ wget -q http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
$ mkfontscale
$ mkfontdir
$ fc-cache -fv ~/.fonts
/home/foobar/.fonts: skipping, existing cache is valid: 1 fonts, 0 dirs
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/foobar/.fontconfig: cleaning cache directory
fc-cache: succeeded

The tools mkfontscale and mkfontdir are part of the package xorg-x11-font-utils if you find they’re not installed on your system, and fc-cache is in the package fontconfig. You can then check out your fonts using the fc-list tool, like so:

$ fc-list | grep Monaco
Monaco:style=Regular,Standard,Testo normale,Normaal,Normal,Común,Almindelig,Vanlig tekst,Normaali,レギュラー

Way back when (internet time here 🙂 ) you had to also run ‘xset fp rehash‘ but I do believe that is no longer necessary with XFS being removed in place of the fontconfig library/infrastructure.

Leave a Reply

Your email address will not be published. Required fields are marked *