Changes

Jump to navigation Jump to search
A major revision; new stuff added. Old mistakes corrected, new created.
== Procedure ==
First Before starting, it is important to understand that the ConTeXt font has to be downloaded somehow. This installation is completely independent from the operating system-specific, fonts. You may have a font which ConTeXt can use but in OS X the <tt>operating system does not see, or vice versa.sit</tt> file In many cases it is downloaded and then installed by double-clicking itvery useful to have the same fonts available, e. It should be noted that for a non-priviledged user the font collection is installed into <tt>/Users/username/Library/Fonts/</tt> folderg. It , it is not necessary nice to be able to install use the same fonts into the systemin illustrations drawn with a drawing package and text typeset by ConTeXt. Unfortunately, there is no simple link between the packaged two font collections can be used as suchsystems.
A slight problem arises from the fact that even though the font itself is a TrueType font (<tt>.ttf</tt>) file, In most cases it is visible as a collection of possible to install the operating system fonts (no file extension). This can be solved by a small utility called <tt>fondu</tt>for ConTeXt to use. The utility comes with OpenOffice or can be downloaded from http://fondu.sourceforgeconverse holds true, as well.net/ . Using Especially the utility OS part of that is very simple: just type certainly beyond the path to the font to be converted: <tt>fondu /Users/username/Library/Fonts/Gentium</tt> and you will get a couple scope of ttf files in this text, but some ideas for the current working directoryopposite are given.
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 === Getting the directory name, anything goes.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 life easiest way to get the <tt>.ttf</tt> files is slightly easier for to download the Windows usersfont files from the foundry (wherever you get your fonts from). Even if your system is Linux or OS X, as the fonts Windows files provide the easiest way to get the font files in the correct format, because they are distributed as almost always either pure <tt>.ttf</tt> or zipped <tt>.ttf</tt> files.  If you have the font installed in Windows or XWin (Of courseLinux, nothing prevents etc.), try to locate the corresponding <tt>.ttf</tt> file (actual location varies by the OS X ). The naming scheme may be confusing, finding the right files may take some effort. Usually you need at least two to four files (bold and Linux users from using that packageitalic are separate files, etc.With OS X the situation is a bit trickier, as the system does not store the <tt>. Just unzipping ttf</tt> files as such. If you either have only the packet will doOS X font file (usually <tt>. Of coursesit</tt>) or the font is only installed in your computer, don't forget you need to double-click extract the actual <tt>.ttf</tt> files if . 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 fonts are font to be installed into the systemconverted, as welle.g. TeX could not care less if : <tt>fondu /Users/username/Library/Fonts/Gentium</tt> and you install will get a couple of <tt>.ttf</tt> files in the current working directory. === Installing the fonts to your operating system=== Once you have obtained the <tt>.ttf</tt> files one way or another, it is really up wise to make a temporary directory somewhere. If you if you want to use them with other applicationsdo not know where, go and make a directory under <tt>/tmp</tt>, for example <tt>/tmp/work</tt>. These two installations are completely independent thingsThere is no magic in the directory name, anything 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>af2pl</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.
 
== 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 Gentium Bold or Bold Italic flavours available, yet. So, "to regularly go where no man has gone before". 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]] 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.
15

edits

Navigation menu