Adding new fonts on a CentOS system

Going through the CentOS documentation talked about two different services for rendering fonts in X, namely fontconfig and xfs. I performed the following steps to get the new fonts working.

  1. Create a new directory under /usr/share/fonts called imported so you will end up with something like /usr/share/fonts/imported
  2. Copy all your newly installable font files to the directory created in step 1.
  3. Open a terminal window and login as root.
  4. Issue the following command to get fontconfig to look at the new fonts.
  5. fc-cache /usr/share/fonts/imported
  6. To make xfs recognize the new fonts a few more steps are required. Each font directory must contain a fonts.dir file.
  7. To create a fonts.dir file, issue the following commands from within the /usr/share/fonts/imported directory.
  8. ttmkfdir -o fonts.scale
  9. mkfontdir
  10. chkfontpath –add /usr/share/fonts/imported/
  11. service xfs reload