World of *Nix

by S. M. Ibrahim (lavluda)
জানুয়ারি 31st, 2007

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!!!!!!!!

Share/Save/Bookmark

Related posts:

  1. how to move your php development environment to linux (Debian/Ubuntu) Nowadays, lots of php developers are thinking to move their...
  2. how to enable mod_rewrite in apache2.2 (debian/ubuntu) Here i am going to describe how to enable mod_rewrite...
  3. install imagemagick support to your debian/ubuntu server imagemagick is one of the best library to work with...
  4. Website Optimization 01: disable ETag in apache (debian/ubuntu) From last few months i am working to optimize our...
  5. Website optimization 02: enable deflate /output compression (debian/ubuntu) On the first post of this series we learned how...

Related posts brought to you by Yet Another Related Posts Plugin.

14 Responses to “Installing ttf fonts on Debian or Ubuntu Linux”

  1. What about this method?

    http://penguinfonts.com/howto/ubuntu.php

    It seems quite a bit easier.

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

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

    thanks marty, i fixed it.

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

  5. 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

  6. 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

  7. In Ubuntu I made a new folder .fonts and paste the solaymanlipi font over there and it worked.

  8. 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

  9. 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.

  10. @rashed, yes, it will work, but then this font will only for work for this user only. you have to do this same work for all users.

  11. 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

  12. 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.

  13. Norman Ramsey Says:
    জুন 6th, 2008 at 1:25 am

    The tutorial at penguinfonts has been shut down. Does anyone hav a copy?

  14. 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.

Leave a Reply