Changes

Jump to navigation Jump to search
no edit summary
{{note | The contents of this page are OLD, from before ConTeXt MKIV. It might need a bit of updating...
 
The easier route than what's on this page is to install the [http://tug.org/gentium/ gentium-tug package]. In TeX Live on Linux, type
<tt>sudo /usr/local/bin/tlmgr install gentium-tug</tt>}}
 
== 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 Latin and greek Greek glyphs (cyrillic Cyrillic to come later). It can be downloaded from the SIL home web page: http://wwwscripts.sil.org/ cms/scripts/page.php?item_id=Gentium.
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.
== Procedure ==
First Before starting, it is important to understand that the ConTeXt font has installation is completely independent from the operating system fonts. You may have a font which ConTeXt can use but the operating system does not see, or vice versa. In many cases it is very useful to have the same fonts available, e.g., it is nice to be downloaded somehowable to use the same fonts in illustrations drawn with a drawing package and text typeset by ConTeXt. This Unfortunately, there is no simple link between the two font systems. In most cases it is possible to install the operating system-specificfonts for ConTeXt to use. The converse holds true, as well. Especially the OS part of that is certainly beyond the scope of this text, but in OS X some ideas for the opposite are given. === Getting the font files === Before anything can be installed, that anything should be obtained. ConTeXt requires the TrueType <tt>.ttf</tt> files (or type 1, but that's another story). The easiest way to get the <tt>.sitttf</tt> file files is downloaded and then installed by double-clicking itto download the Windows font files from the foundry (wherever you get your fonts from). It should be noted that for a non-priviledged user Even if your system is Linux or OS X, the Windows files provide the easiest way to get the font collection is installed into files in the correct format, because they are almost always either pure <tt>.ttf</Users/username/Library/Fonts/tt> or zipped <tt>.ttf</tt> folderfiles. If you have the font installed in Windows or XWin (Linux, etc. It is not necessary ), try to install locate the fonts into corresponding <tt>.ttf</tt> file (actual location varies by the systemOS). The naming scheme may be confusing, finding the packaged font collections can be used as suchright files may take some effort. Usually you need at least two to four files (bold and italic are separate files, etc.)
A slight problem arises from the fact that even though With OS X the font itself situation is a TrueType bit trickier, as the system does not store the <tt>.ttf</tt> files as such. If you either have only the OS X font file (usually <tt>.ttfsit</tt>) fileor the font is only installed in your computer, it is visible as a collection of fonts (no file extension)you need to extract the actual <tt>.ttf</tt> files. This can be solved by Go and get 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, e.g.: <tt>fondu /Users/username/Library/Fonts/Gentium</tt> and you will get a couple of <tt>.ttf </tt> 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 === Installing the directory name, anything goes.fonts ===
The life is slightly easier for Windows users, as Once you have obtained the fonts are distributed as zipped <tt>.ttf</tftt> files. (Of courseone way or another, nothing prevents OS X and Linux users from using that package)it is wise to make a temporary directory somewhere. Just unzipping the packet will If you do. Of coursenot know where, don't forget to double-click the files if the fonts are to be installed into the systemgo and make a directory under <tt>/tmp</tt>, as wellfor example <tt>/tmp/work</tt>. TeX could not care less if you install There is no magic in the fonts to your operating systemdirectory name, it is really up to you if you want to use them with other applications. These two installations are completely independent thingsanything goes.
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>sudo texfont --ve=sil --co=gentium --makepath --install</tt>
Note that the passwword password 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!
 
The command above will make the fonts with texnansi encoding. If you don't know what encodings are, then just let it be as it is. If you need another encoding (such as ec, 8r), it can be specified with a switch <tt>--en=ec</tt>. You can install the same font several times with different encodings; the naming scheme allows coexistence.
 
With the simple command line you may have problems with ligatures. For example, two hyphens <tt>--</tt> in the source file still print as two hyphens (not as an en dash). This can be cured by giving the switch <tt>--afmpl</tt> which tells <tt>texfont</tt> to use a slightly more intelligent utility (<tt>afm2pl</tt>) with the fonts.
 
Unfortunately, there seems to be a file missing in gwTeX, so you will need to get <tt>default.lig</tt> somewhere. The easiest way is to download it from http://www.tug.org/ftp/texlive/Contents/testinstalled/texmf/fonts/lig/afm2pl/default.lig . Placing it in your working directory is enough, but you could also download all the <tt>.lig</tt> files in that directory and putting them in your own TeX tree at fonts/lig/afm2pl, and then run texhash/mktexlsr.
== 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 fontmy 1.25 GHz G4 it takes around a minute), but the result will be a few pages of glyphs.  == Using the fonts in a document == To use the fonts in a document, a few definitions are needed. A simple test document is shown below: <texcode>\loadmapfile[ec-sil-gentium.map]\usetypescriptfile[type-buy] \starttypescript [serif] [Gentium] [ec] \usetypescript[serif][fallback] \definefontsynonym [Gentium-Roman] [ec-GentiumRegular] [encoding=ec] \definefontsynonym [Gentium-Italic] [ec-GentiumItalic] [encoding=ec]\stoptypescript \starttypescript [serif] [Gentium] [name] \usetypescript[serif][fallback] \definefontsynonym [Serif] [Gentium-Roman] \definefontsynonym [SerifItalic] [Gentium-Italic]\stoptypescript \starttypescript [Gentium] \definetypeface [MyGentium] [rm] [serif] [Gentium] [default] [encoding=ec]\stoptypescript \usetypescript[Gentium]\setupbodyfont[MyGentium,11pt] \starttext This is Gentium! {\it This is Gentium Italic!} \stoptext</texcode> One important thing to note is that '''there aren't Bold or Bold Italic flavours''' available yet for Gentium Plus. So, "to regularly go where no man has gone before". But bold Gentium Basic and Gentium Book Basic do include bold and bold italic. Of course, you can (and probably should) put the typescript definitions into another file so that they can be reused in other documents. For more information on using typescripts, Wiki around! My suggestion is to start with the [http://home.salamander.com/~wmcclain/context-help.html Bill McClain's ConTeXt beginners page] and then check the [[TypeScripts - Old Content]] page. Note that the font names on the latter are slightly different from the ones on this page even though the font is the same. [[Category:Old Content]]

Navigation menu