Changes

Jump to navigation Jump to search
no edit summary
== Background ==

I wanted to install the very fine Gentium font to my computer. The font is a free font with a very wide collection of latin and greek glyphs (cyrillic to come later). It can be downloaded from the SIL home page: http://www.sil.org/ .

While the font system is rather elegant and can be tweaked every possible way, it is difficult to get started with. For a beginner, new fonts may feel extremely difficult to install.

There are several good introductions to the subject. This is not one of those, as I am not going to tell a word about why or what. This is just a description of how I managed to install a new font. The process is surprisingly easy if it goes smoothly. If it doesn't, then I cannot help... If you want to stay out of trouble, please test your ConTeXt installation before installing the fonts. If it doesn't work before, it won't after.

My installation is a rather recent gwTeX (31 Jan 05) on Mac OS X with a ConTeXt installation from the same date. As the distribution is based on TeX Live, I guess the instructions given here should be rather universal. I am sorry, but the instructions give all the commands in the Unix form, so Windows users have to adapt. I try to give some hints to Windows and Linux users, as well, but everything is untested.

== Procedure ==

First the font has to be downloaded somehow. This is system-specific, but in OS X the <tt>.sit</tt> file is downloaded and then installed by double-clicking it. It should be noted that for a non-priviledged user the font collection is installed into <tt>/Users/username/Library/Fonts/</tt> folder. It is not necessary to install the fonts into the system, the packaged font collections can be used as such.

A slight problem arises from the fact that even though the font itself is a TrueType font (<tt>.ttf</tt>) file, it is visible as a collection of fonts (no file extension). This can be solved by a small utility called <tt>fondu</tt>. The utility comes with OpenOffice or can be downloaded from http://fondu.sourceforge.net/ . Using the utility is very simple: just type the path to the font to be converted: <tt>fondu /Users/username/Library/Fonts/Gentium</tt> and you will get a couple of ttf files in the current working directory.

At this point it is wise to make a temporary directory somewhere. If you do not know where, go and make a directory under <tt>/tmp<tt>, for example <tt>/tmp/work</tt>. There is no magic in the directory name, anything goes.

The life is slightly easier for Windows users, as the fonts are distributed as zipped <tt>.ttf</tf> files. (Of course, nothing prevents OS X and Linux users from using that package). Just unzipping the packet will do. Of course, don't forget to double-click the files if the fonts are to be installed into the system, as well. TeX could not care less if you install the fonts to your operating system, it is really up to you if you want to use them with other applications. These two installations are completely independent things.

Now we have a nice temporary directory somewhere and a few <tt>.ttf</tt> files in it. Then the actual font installation goes with a magic command (read on, if you want to avoid some pitfalls with file permissions):

<tt>texfont --ve=sil --co=gentium --makepath --install</tt>

This tells the wonderful <tt>texfont</tt> script to process all the <tt>.ttf</tt> files in the directory (you can limit the choice by supplying file names to the end of the command). The vendor of the fonts is <tt>sil</tt> and the name for the font collection is <tt>gentium</tt>. Again, there is no magic in these names, they are just used as directory names in the <tt>texmf</tt> tree. However, using just anything will make administration harder later on, so try to stick to reality.

The last two switches tell the script to make all missing directories and install the actual <tt>.ttf</tt> files to the right place in the <tt>texmf</tt> tree. In my case everything was installed into the local tree (<tt>/usr/local/teTex/share/texmf.local/...</tt>).

Beware, you will need administrative priviledges (power user, administrator, root) to be able to change the <tt>texmf</tt> tree. On Unix/Linux/OS X systems you can either log in as <tt>root</tt> which is not a good idea in general or use <tt>sudo</tt>. In OS X and other <tt>sudo</tt>-aware operating systems the following will work for all power users:

<tt>sudo texfont --ve=sil --co=gentium --makepath --install</tt>

Note that the passwword asked at this point is your password, not the root password.

In Windows, you should log in as a Power User (Administrator, whatever, different names in different versions of Windows). Otherwise you will end up with permission conflicts.

If you manage to get to this point and <tt>texfont</tt> does not complain much, the fonts are installed!

== Testing the fonts ==

One of the nicest features in <tt>texfont</tt> is that it produces a test file. In this case the file is called <tt>texnansi-sil-gentium.tex</tt>. This file can be run by <tt>texexec --pdf texnansi-sil-gentium.tex</tt>. It will take a while especially with the Gentium font, but the result will be a few pages of glyphs.
15

edits

Navigation menu