How to use otf fonts in Linux

  1. Download any otf/ttf font from internet and save in a directory on your machine.
  2. Go to the directory in which you have saved the font file.
  3. Login as root.
  4. Create a directory /usr/share/fonts/default/TrueType using following command.
    $ mkdir /usr/share/fonts/default/TrueType
  5. Copy the font file in /usr/share/fonts/otfonts/
    cp *.otf /usr/share/fonts/default/TrueType
  6. Go to directory /usr/share/fonts/default/TrueType
    cd /usr/share/fonts/default/TrueType
  7. Create fonts.scale
    ttmkfdir
    or
    /usr/sbin/ttmkfdir
  8. Create fonts.dir
    >mkfontdir
  9. Add the path to X Font serve path
    chkfontpath --add /usr/share/fonts/default/TrueType
    or
    /usr/sbin/chkfontpath --add /usr/share/fonts/default/TrueType
  10. Update font information cache
    fc-cache
  11. Logout as root
    >exit 
# you must be in directory with your .otf files!
# (C) Vijay Kumar, 2005
su
mkdir /usr/share/fonts/default/TrueType
cp *.otf /usr/share/fonts/default/TrueType
cd /usr/share/fonts/default/TrueType
/usr/sbin/ttmkfdir
mkfontdir
/usr/sbin/chkfontpath --add /usr/share/fonts/default/TrueType
fc-cache

How to convert otf fonts to ttf

To convert an otf font to ttf (because OpenOffice does not care about otf fonts), you can use the following procedure.

#!/usr/local/bin/fontforge
#! (C) Thomas Maier, 2007
# Usage:
#   for i in *.otf; do echo $i; fontforge -script ~/bin/otf2ttf.sh $i; done
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);
After saving this procedure to a convinient place, you can use it (using bash) in the following manner:
for i in *.otf; do echo $i; fontforge -script ~/bin/otf2ttf.sh $i; done