Monday, December 08, 2008

Installing Microsoft truetype fonts in Ubuntu

A. Create the Microsoft truetype directory in Ubuntu:

sudo mkdir /usr/share/fonts/truetype/microsoft

B. Copy the ttf and TTF fonts from the Windows Fonts directory into the directory created in step 1. Here ${NTFSHOME} is the mountpoint in Ubuntu of your Windows filesystem (when using ntfs-3g). Otherwise, just copy all the ttf/TTF files from Windows onto USB thumbdrive and transfer to Ubuntu:

cd /usr/share/fonts/truetype/microsoft
sudo cp ${NTFSHOME}/WINDOWS/Fonts/{*ttf,*TTF} .

C. Make all the ttf/TTF files readable by everyone (when copied from USB it is probably rwx by root and no permissions for anyone else--this is bad):

sudo chmod 644 *ttf *TTF

D. Install the ttmkfdir package. Omit this step if you already have it:

sudo apt-get install ttmkfdir

E. Create the fonts.scale and fonts.dir files in the microsoft truetype directory:

cd /usr/share/fonts/truetype/microsoft
sudo ttmkfdir *ttf *TTF
sudo cp fonts.scale fonts.dir

F. Recreate the font-cache files for X font server

sudo fc-cache -f -v

G. Start OpenOffice writer and check if you can access the fonts "Times New Roman" and "Arial". If you can, then you are done. Congratulations!



Allan Espinosa said...

you could install the msttcorefonts package and it will download the publicly available ms fonts for you.

this is an easier alternative specially if you don't have windows co-installed.

Ambo said...

Allan: Thanks. Kumusta na?