Tuesday, December 28, 2004

Adding Truetype Fonts

How to install truetype font in linux ?

1) We need to create a directory first to hold all truetype fonts. Normally i create it at /usr/local/fonts/ttf

2) Then copy all truetype fonts into this directory.

3) Now cd /usr/local/fonts/ttf directory.

4) Enter the following commands

# ttmkfdir > fonts.scale
# mkfontdir

5) Now if you view the directory you will see 2 new files "fonts.scale" and "fonts.dir"

6) Now Redhat users can use the following command

chkfontpath -a /usr/local/fonts/ttf

7) If you don't have the chkfontpath command, you will have to edit the file /etc/X11/xfs/config (or /etc/X11/fs/config), find the line which starts with "catalog=", and add your directory at the end of the list, separated by a comma.

8) That's it! You can test it now by running the xfontsel program from the terminal, or run the "Font Selector" program from the Utilities menu in Gnome. You should immediately see the truetype font names in the list of fonts.

9) If you add more fonts to the directory you have to re-run the following commands to regenerate the fonts.dir file:

# ttmkfdir > fonts.scale
# mkfontdir

No comments: