Posted in

Installing ttf fonts on Debian or Ubuntu Linux

Here is the simple step to install ttf font on Debian or Ubuntu or debian based linux.

First of all make a font directory to store the fonts. Better use “/usr/share/fonts/ttf”

So make the font directory:

Debian (login as root or use su):

mkdir /usr/share/fonts/ttf

Ubuntu:

sudo mkdir /usr/share/fonts/ttf

If u want to install the ttf font from windows, simple copy them from c:\windows\Fonts

Debian:

mkdir windows
mount /dev/hda1 windows
cd windows/Fonts
cp *.ttf /usr/share/fonts/ttf

Ubuntu:

mkdir windows
sudo mount /dev/hda1 windows
cd windows/Fonts
sudo cp *.ttf /usr/share/fonts/ttf

Now u need to generate the fonts.scale fonts.dir, so u have to install the ttmkfdir and mkfontdir.
Debian:

apt-get install ttmkfdir

cd /usr/share/fonts/ttf
ttmkfdir > fonts.scale
mkfontdir

Ubuntu:

sudo apt-get install ttmkfdir

cd /usr/share/fonts/ttf
sudo ttmkfdir > fonts.scale
sudo mkfontdir

Most of the works finished. U only need to add the font path to xwindows.

Debian:

nano /etc/X11/xorg.conf

Ubuntu:

sudo nano /etc/X11/xorg.conf

then add the fontpath to xorg.conf

FontPath “/usr/share/fonts/ttf”

Now restart ur display manager or total system.
Debian:

/etc/init.d/gdm restart

Ubuntu:

sudo /etc/init.d/gdm restart

If nothing goes wrong, ur done. Congrutulation!!!!!!!!

15 thoughts on “Installing ttf fonts on Debian or Ubuntu Linux

  1. Nice instructions.
    I’m running Ubuntu 6.10 and apt couldn’t find “mkfontdir”. But I just skipped it and everything else worked fine.

  2. thanks george , that is easy, but you cann’t create new font dir with that process.

    thanks marty, i fixed it.

  3. Thanks, great article. It works as I wanted for me.. All *.ttf now available on my Debian GNU/Linux……..

  4. Hello!

    This was a very useful tutorial, but too bad it didn’t work for me.

    I did everything as it said and got no errors, but after I restarted my system,
    It set itself to low-graphics mode, which scared me a little, but I fixed that now.
    I Still can’t see the fonts that I should have installed using this method.
    Maybe I need a space between “Font” and “Path”?
    Could anyone help me out?
    Thanks!

    – Devo

  5. hi devo.

    i think you made mistake in line
    FontPath “/usr/share/fonts/ttf”

    please don’t copy this line, type it , because of my theme it will place wrong quote.

    please let me if you still getting problem.

    thanks

  6. Hi,
    I’ve followed all the steps and the fonts seem to have installed because I can see the correct font when I load a document in OpenOffice, but when I try to select the font in a dropdown list none of the installed fonts are there.

    Also, for some reason now Iceweasel crashes whenever I try to load Google. Nothing else has changed, so I’m wondering if updating the fonts has somehow caused this problem?

    Thanks for any advice

  7. jamie, can you please run firefox from terminal, i think then you will get the error message.

    may be some of your fonts have problem for linux. long time back i also faced this problem. and removing that font from the font directory is the solution.

  8. Hi lavluda, thanks for the prompt reply. Iceweasel crashes with a “segmentation fault”.

    Do you think the fonts not appearing in the OO.o font list is related to the iceweasel issue, or totally separate?

    Thanks mate

  9. UPDATE…
    Your advice about some fonts causing problems in linux made sense because I had originally dumped many fonts into the directory. I went back and cleared them out, and only re-installed the few that I needed.

    This fixed the iceweasel problem, but I still couldn’t see the fonts in OO.o. I found this procedure on the web.

    http://machine-cycle.blogspot.com/2008/01/installing-truetype-fonts-on-debian.html

    I don’t understand the differnece between your tutorial and the procedue from the link above, but it’s all working ok now.

  10. You should probably use /usr/local/share/fonts rather than /usr/share/fonts (the latter is managed by the system, the former (/usr/local) is where you’re allowed to do this kind of installation-specific thing).

    Confirm that there are entries in /etc/fonts/fonts.conf – there should be a reference for /usr/local/share/fonts in there already, but it pays to check. Running fc-cache -f after is still required of course.

    If you’re going to install lots of new fonts you can maintain a sensible structure, eg. truetype/ , type1/ , and so on.

  11. I am looking for hindi fonts for Ubuntu 11.10 following ones

    Chanakya ChanakyaBold Helvetica-Bold
    Helvetica Alankar ChanakyaItalic
    Alankar
    where can I get these I have a Windows7

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.