Using a truetype font in TeX 

> I've got a truetype font and i need to output a
> .dvi/.ps file using that font. How do i do it?

If you are using a Unix/Linux system, there is a shell-script available which will do pretty much all of the work for you: see http://lehman.virtualave.net/files/ttf2tex.tar.gz. There is good documentation with the script which explains what needs to be done to install TrueType fonts — you may want to read it even if you can't use the script. Essentially the same method (though done manually) is described at http://www.radamir.com/tex/

Note that there are two (at least) methods of using TTF's with TeX. You can convert the TTF's to Postscript Type 1 fonts, and then install and use them as you would any other Type1 font. This is the method described by the document in the /info/truetype (IIRC) directory of CTAN. The problem with this is that there is always a loss of quality in the translation --- some fonts I have tried converting this way end up looking downright nasty.

Much better (and this is how the linked documents above do it) is to use the program ttf2pk — which employs the FreeType library, available for all platforms from CTAN (and, if you run Linux, it's probably already part of your system) — which creates pk files `on the fly' directly from the .ttf file, when they are needed in the document. TTF files can also be embedded directly into a PDF document, and PDFTeX can do it; the explanations are given at the links above.

Robert

Using a truetype font in TeX 

> > TTF files can also be embedded directly into a PDF document, and
> > PDFTeX can do it; the explanations are given at the links above.
>
> Do they appear scalable or as bitmaps?

They are embedded as vector fonts if all is configured correctly. BTW: dvips can embed TrueType fonts as vector fonts, too.

Christian.

Using TrueType fonts with TeX (LaTeX) and pdfTeX (pdfLaTeX) 

http://www.radamir.com/tex/ttf-tex.htm

Damir Rakityansky

Before we begin (TeX) 

Suppose, we want to typeset in Times New Roman instead of Computer Modern Roman (cmr). Times New Roman in Windows 9x/NT 4 is a Unicode font which has almost all symbols from Computer Modern. Certainly, they are in different places. To use these fonts in TeX (LaTeX) and PDF documents, it is necessary to create two more fonts: raw tex font, containing necessary characters but without kerning information, and virtual tex font with kerns and ligatures. For simplicity, we'll use the rule that if TrueType font file has a name foo.ttf, than virtual tex font in T1 encoding will be named ecfoo and raw tex font will be named recfoo. Times New Roman family of fonts is presented by the files times.ttf, timesi.ttf, timesbd.ttf and timesbi.ttf, found in c:\windows\fonts directory in Windows 9x or c:\winnt\fonts in Windows NT. The family has Regular, Italic, Bold and BoldItalic members. We'll also create oblique (slanted) versions of Regular and Bold members, which will be marked by letter "o" at the end of the name. The above is summarized in a table:

Also we'll need an encoding vector — a file which determines characters positions in a new fonts. We'll use a file T1-WGL4.enc which corresponds to T1 encoding.

Tip To be able to typeset with Cyrillic characters, you should use T2A-mod0.enc file or similar, found in T2 package.

Create a temporary working directory and copy font files (times.ttf, timesbd.ttf, timesbi.ttf, timesi.ttf from c:\windows\fonts [Attention! Directory is hidden.]) and encoding file (T1-WGL4.enc) there. Now we are ready for actual work.

Creating TeX Font Metrics (tfm) 

Run commands:

ttf2tfm times.ttf -q -T T1-WGL4.enc -v ectimes.vpl rectimes.tfm >> ttfonts.map
ttf2tfm timesi.ttf -q -T T1-WGL4.enc -v ectimesi.vpl rectimesi.tfm >> ttfonts.map
ttf2tfm timesbd.ttf -q -T T1-WGL4.enc -v ectimesbd.vpl rectimesbd.tfm >> ttfonts.map
ttf2tfm timesbi.ttf -q -T T1-WGL4.enc -v ectimesbi.vpl rectimesbi.tfm >> ttfonts.map

This will create a tfm files of raw fonts and vpl files of virtual fonts. To generate slanted versions of regular and bold font, command should be extended like this:

ttf2tfm times.ttf -q -T T1-WGL4.enc -s .167 -v ectimeso.vpl rectimeso.tfm >> ttfonts.map
ttf2tfm timesbd.ttf -q -T T1-WGL4.enc -s .167 -v ectimesbdo.vpl rectimesbdo.tfm >> ttfonts.map

Creating Virtual Fonts (vf) 

Run commands:

vptovf ectimes.vpl ectimes.vf ectimes.tfm
vptovf ectimesi.vpl ectimesi.vf ectimesi.tfm
vptovf ectimesbd.vpl ectimesbd.vf ectimesbd.tfm
vptovf ectimesbi.vpl ectimesbi.vf ectimesbi.tfm
vptovf ectimeso.vpl ectimeso.vf ectimeso.tfm
vptovf ectimesbdo.vpl ectimesbdo.vf ectimesbdo.tfm

This creates vf and tfm files for virtual fonts. After that you can delete vpl files:

del *.vpl

Installation of fonts for TeX and LaTeX 

Now vf and tfm files should be moved to the place where MiKTeX can find them. Move all vf files to c:\localtexmf\fonts\vf\ms\times\, and all tfm files to c:\localtexmf\fonts\tfm\ms\times\. The directories ms\times are not mandatory, you can leave the files even in parent dirs, but this way it is easier to maintain them and it corresponds to the general rule of placement: <supplier>\<family>.

Open the file ttfonts.map in a temporary working directory with your favorite text editor (notepad :) and copy its contents to clipboard. Now open a file c:\texmf\ttf2tfm\base\ttfonts.map with the same editor and paste the lines from clipboard. Beware that your editor does not wrap long lines automatically. Save the file.

This is sufficient for generating DVI file, but to view or print it, there should be a raster (pk) font. MiKTeX will attempt to generate it automatically with new utility: ttf2pk. For successful generation ttf2pk should find both TrueType font and encoding file. It happens that ttf2pk can find ttf files, if they are installed and are in a system fonts directory, and it looks for encoding files in a directory c:\texmf\pdftex\base\ (among others).Therefore you have to copy T1-WGL4.enc to c:\texmf\pdftex\base\.

Now we have to update databases:

Start=>Programs=>MiKTeX=>Maintenance=>Refresh Filename Database

Testing the installation in TeX 

Change current directory from temporary working to some other where there are no files related to fonts creation. To have a look at our brand new fonts, run a command

tex testfont

It will ask about a font to test. Enter "ectimes". It will ask about a command. Enter "\table\eject\init". This time enter "ectimeso", then "ectimesbd" and so on. After all fonts are tested, enter a command "\bye". This will create a file testfont.dvi in current directory.

Tip If you have problems at this stage, it is either wrong font names or tfm, vf files placement.

But do not hurry to open testfont.dvi with YAP. If something goes wrong, it is quite hard to trace the problem in YAP. Better try converting dvi to PostScript:

dvips testfont.dvi

Here you will have plenty of messages about what is happening. In particular, the generation of pk for TrueType will look like this:

- make_pk_font (rectimes, 600, 600, ljfour)
name: rectimes, dpi=600, bdpi=600, mag=magstep(0.0), mode=ljfour
C:\texmf\miktex\bin\makemf.exe --verbose rectimes
Cannot find rectimes source file.
C:\texmf\miktex\bin\ttf2pk.exe -q -n rectimes 600
ttf2pk: WARNING: Cannot map character `compwordmark'.
ttf2pk: WARNING: Cannot map character `perthousandzero'.
ttf2pk: WARNING: Cannot map character `dotlessj'.
ttf2pk: WARNING: Cannot map character `ff'.
ttf2pk: WARNING: Cannot map character `ffi'.
ttf2pk: WARNING: Cannot map character `ffl'.
ttf2pk: WARNING: Cannot map character `visualspace'.
ttf2pk: WARNING: Cannot map character `Germandbls'.
Creating rectimes.pk...
move rectimes.pk
C:\localtexmf\fonts\pk\modeless\ms\times\dpi600\rectimes.pk

As you can see, Times New Roman is missing several characters, most notably ff, ffi and ffl ligatures.

Using new fonts in TeX 

To use new fonts in TeX, you can issue a commands like:

\font\myfont=ectimes
\font\mybigfont=ectimes at 36pt
\myfont Hello, I am being typeset in Times New Roman

\mybigfont Me too...

Using new fonts in LaTeX 

LaTeX requires some additional efforts. Create a font definition file t1tnr.fd in c:\localtexmf\tex\latex\winfonts directory with the following contents:

\ProvidesFile{t1tnr.fd}[Put your description of font here]

\DeclareFontFamily{T1}{tnr}{}

\DeclareFontShape{T1}{tnr}{b}{n}{<->ectimesbd}{}
\DeclareFontShape{T1}{tnr}{b}{sl}{<-> ectimesbdo}{}
\DeclareFontShape{T1}{tnr}{b}{it}{<-> ectimesbi}{}

\DeclareFontShape{T1}{tnr}{m}{n}{<-> ectimes}{}
\DeclareFontShape{T1}{tnr}{m}{sl}{<-> ectimeso}{}
\DeclareFontShape{T1}{tnr}{m}{it}{<-> ectimesi}{}

\DeclareFontShape{T1}{tnr}{bx}{n}{<->ssub * tnr/b/n}{}
\DeclareFontShape{T1}{tnr}{bx}{sl}{<->ssub * tnr/b/sl}{}
\DeclareFontShape{T1}{tnr}{bx}{it}{<->ssub * tnr/b/it}{}

\endinput

Now you can use new fonts in LaTeX like the following:

\documentclass{article}
\begin{document}
\usefont{T1}{tnr}{m}{sl}

Hello, I am being typeset in Times New Roman Slanted

\end{document}

Finally, if you want to use Times New Roman as you default roman font, put two \renewcommand command in preamble:

\documentclass{article}

\renewcommand{\encodingdefault}{T1}
\renewcommand{\rmdefault}{tnr}

\begin{document}

Hello, I am being typeset in \textsl{Times New Roman Slanted}

\end{document}

Now you can try use pdftex and pdflatex to create PDF documents but new fonts will be embeded as bitmaps which makes the whole pdf-story half useless. Let's see how to embed TrueType fonts in PDF documents in native format.

Testing the installation in pdfTeX 

Change current directory from temporary working to some other where there are no files related to fonts creation and run a command

pdftex testfont

It will ask about a font to test. Enter "ectimes". It will ask about a command. Enter "\table\eject\init". This time enter "ectimeso", then "ectimesbd" and so on. After all fonts are tested, enter a command "\bye". Screen output will be like this:

pdftex testfont
This is pdfTeX, Version 3.14159-12r (MiKTeX 1.11c)
(pdftex.cfg) (testfont.tex
Name of the font to test = ectimes
Now type a test command (\help for help):)
*\table\eject\init
[1<cm.map><winfonts.map>]
Name of the font to test = ectimesbdo
Now type a test command (\help for help):
*\table\bye
[2]<T1-WGL4.enc><timesbd.ttf><cmttext.enc><cmtt10.pfb><times.ttf><cmitext.enc><
cmti10.pfb><T1-WGL4.enc><cmr10.pfb><cmr7.pfb>
Output written on testfont.pdf (2 pages, 195888 bytes).
Transcript written on testfont.log.

As you can see, this time pdftex has found winfonts.map and embeded encodingg file T1-WGL4.enc and TrueType fonts times.ttf and timesbd.ttf into resulting PDF document. Open testfont.pdf with GSview and you will see:

Using a Truetype font in Pdflatex 

http://ipe.compgeom.org/pdftex_1.html

I'll explain the necessary steps for adding a TTF font using the Lucida-Handwriting font lhandw.ttf as an example (one can find this font on most PCs).

Note that there is an alternative route for making documents using Truetype fonts: You could convert the TTF font to Postscript Type 1 format, using the tool ttf2pfb. (The use of Postscript fonts is now quite standard in Tex, and you can use these fonts in ordinary Latex, with dvips as a postprocessor—you don't need Pdflatex.) The font conversion process converts the font outlines flawlessly, as TTF's quadratic Bezier splines can be converted exactly into Postscript cubic Bzier splines. Postscript and Truetype fonts use different hinting systems, though, and so hinting is not converted. This is fine as long as you plan to print the resulting document (printer resolutions are so good that hinting is irrelevant). But when the document is displayed on a screen in, say, Acrobat Reader, using the original TTF font seems to give a better result. For more information about Pdftex font handling, see the links on the TUG pdftex support page.

And then, it can be done, so why not? :-)

Checking the Pdftex version 

First, let's check the version of pdflatex:

mihoen[~].. pdflatex This is pdfTeX, Version 3.14159-13d (Web2C 7.3.1) **

So it appears that this RedHat distribution came with pdftex 0.13d, which is ancient. You need at least version 1.21a (see the Pdftex page to verify what the current version is).

It is not easy to only recompile/reinstall Pdftex because of the interdependencies of the various TeX components. Just update your installation of MikTeX/tetex using the official mechanism.

Providing the font metrics files 

We need to put the font where Pdflatex can find it. Let's try the current directory:

mihoen[~].. kpsewhich -progname=pdflatex lhandw.ttf
./lhandw.ttf

It seems Pdflatex can find it all right.

Now we have to create a TFM file (Tex metric file) for the font. I'm using ttf2tfm for this. This tool wasn't installed on my Linux system. You can probably find an rpm package that installs it on Linux, such as Suse's freetype-tools.rpm. If you use MikTeX 2.0, ttf2tfm is already there. I simply built it from sources.

I also copied the encoding file T1-WGL4.enc from the ttf2tfm package. (Here is a local copy.)

mihoen[~].. ttf2tfm lhandw.ttf -p T1-WGL4.enc

<...lots of output, listing all the characters, and complaining
about characters that haven't been found ...>

Using T1-WGL4.enc as input encoding.

lhandw   lhandw.ttf Encoding=T1-WGL4.enc

The last line output is meant to be put into the fontmap file. I'm not sure whether Pdflatex can handle this syntax — the one I've shown above works in any case.

For the moment, I just left the resulting file lhandw.tfm in the current directory. Check that Pdflatex will find it there:

mihoen[~].. kpsewhich -progname=pdftex lhandw.tfm
./lhandw.tfm

Setting up the Latex font 

Now we need to ask Latex to use the new font. Here is a little test file test.tex.

% File 'test.tex'
\documentclass{article}
\renewcommand{\encodingdefault}{T1}
\renewcommand{\rmdefault}{lhandw}
\renewcommand{\sfdefault}{phv}
\renewcommand{\ttdefault}{pcr}
\title{Using Lucida Handwriting}
\author{Otfried Cheong}
\begin{document}
\maketitle
This is just a---silly---test of the Lucida-Handwriting font.
\end{document}

This makes Lucida-Handwriting the default roman font (and uses Helvetica and Courier as sans-serif and typewriter fonts). If you just wished to use the Lucida font somewhere in your document, you could use the following:

\usefont{T1}{lhandw}{m}{n}

Or, more professionally, you would put this in the preamble:

\DeclareTextFontCommand{\textlh}
{\fontencoding{T1}\fontfamily{lhandw}\selectfont}

Running Pdflatex on test.tex succeeds, but shows this message:

LaTeX Font Warning: Font shape `T1/lhandw/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 8.

Pdflatex still doesn't know about the font. What is missing is a font description file. Latex is looking for the font "T1/lhandw/m/n", so this file has to be called t1lhandw.fd. I've created such a file in the current directory:

\ProvidesFile{t1lhandw.fd}[Lucida-Handwriting font]

\DeclareFontFamily{T1}{lhandw}{}

\DeclareFontShape{T1}{lhandw}{m}{n}{
   <-> lhandw
}{}

\DeclareFontShape{T1}{lhandw}{bx}{n}{<->ssub * lhandw/m/n}{}

\DeclareFontShape{T1}{lhandw}{m}{it}{<->ssub * ptm/m/it}{}
\DeclareFontShape{T1}{lhandw}{m}{sl}{<->ssub * ptm/m/sl}{}
\DeclareFontShape{T1}{lhandw}{m}{sc}{<->ssub * ptm/m/sc}{}

\DeclareFontShape{T1}{lhandw}{bx}{it}{<->ssub * ptm/b/it}{}
\DeclareFontShape{T1}{lhandw}{bx}{sl}{<->ssub * ptm/b/sl}{}
\DeclareFontShape{T1}{lhandw}{bx}{sc}{<->ssub * ptm/b/sc}{}

\pdfmapline{+lhandw\space <lhandw.ttf\space <T1-WGL4.enc}

We tell Pdflatex to use the Lucida font for both the normal medium and the bold style. The remaining six declarations tell Pdflatex to substiture the Times font for the italic, slanted, and small-caps shapes of the roman font.

The resulting PDF file looks fine in both Xpdf and Acrobat Reader.

Cleaning up the mess 

By now we have cluttered up the current directory with lots of new files: t1lhandw.fd, T1-WGL4.enc, lhandw.ttf , and lhandw.tfm. All of these should go into a nice cosy place on the system, so that they can be found whereever Pdflatex is run.

If you are not a system administrator on a Unix system, you would just create your own small TeX-tree, and set the environment variables TEXPSHEADERS (for .enc files), TTFONTS for Truetype fonts, and TEXINPUTS for .fd files.

If you are a system administrator, you should move the files to suitable places in the local TeX-tree.

On MikTeX, I recommend creating a local TeX-tree as well. Create a directory, say c:\Mytexmf and start the MikTeX options program (in the MikTeX menu). In the "Roots" tab, press "Add" and select the directory you just created. Move it up so that it is before the standard root directory (c:\texmf). You can now check the configuration file \texmf\miktex\config\miktex.ini for the exact paths searched by MikTeX. One choice would be

After copying, press the "Refresh FNDB" button to update MikTeX's filename database.

It should now work to compile test.tex even when that is the only file in the current directory.

Otfried Cheong

True Type to Type1 Conversion 

http://www.linuxselfhelp.com/HOWTO/Font-HOWTO-6.html#ss6.2

To convert your TrueType fonts into Type1 fonts, go to http://quadrant.netspace.net.au/ttf2pt1/ and get ttf2pt1. To convert a TrueType to a Type1 font, use the following syntax:

ttf2pt1 -b file.ttf name

Where name is the name of the file corresponding to the new Type1 font ( ie it's arbitrary. It's a good idea to make it the same as the ttf file. eg ttf2pt1 -b foo.ttf foo.

Well, that worked fine for one font. If we have a lot, we need a smarter way to do it. One can just just use a loop:

for X in *.ttf; do ttf2pt1 -b $X ${X%%.ttf}; done

Alternatively, you can download the ttfutils package and use ttf2type1 for the conversions.

ttf2type1 *.ttf

Copyright 2005 LinuxSelfhelp.com

documented on: 2006.04.23

Printing TrueType fonts in Unix 

http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/printing.html

Conversion to Type 42 

A Type 42 font is a TrueType font encapsulated in a PostScript dictionary that makes it superficially similar to other PostScript fonts; the conversion is therefore lossless (i.e. all the information in the TrueType font is preserved). Unfortunately, only recent versions of PostScript (starting with Adobe Postscript 2013) know how to deal with such fonts. As Type 42 fonts look like the more usual Type 1 fonts, most application software can be coerced into using them. I have successfully used this approach with LaTeX2e and dvips.

If your printer supports Type 42, this is by far the best solution. This small PostScript utility (to be sent to your printer) will help you determine whether this is indeed the case.

Conversion of TrueType into Type 42 can be done by ttfps (this program also generates AFM font metric files). Alternatively, you may want to use ttf2pf, provided by the Polish TeX Users' Group (GUST), which uses GhostScript and does not require any compilation. There is also ttftot42.

The Type 42 format is described in the Adobe technote 5012. It can be found with the other Adobe technical notes for developers.

Conversion of outlines to Type 1 or Type 3 

It is possible to convert TrueType fonts into more traditional PostScript fonts; unfortunately, the process loses all instructions (hinting information). This means that unless you are using a very high-resolution device the results will be somewhat disappointing at small sizes.

Type 1, the usual PostScript font format, contains outline descriptions in a restricted form of PostScript; Type 1 fonts can be used with software such as X11, IBM OS/2, or the Adobe Type Manager (ATM). Type 3 fonts, on the other hand, require a full PostScript interpreter.

Programs for doing the conversion include ttf2pt1 (conversion to Type 1) and ttf2pfa (conversion to Type 3).

Conversion to bitmaps 

The FreeType library — of which you probably already have a copy — should enable you to generate bitmaps of your favourite TrueType fonts. The contrib directory of the full distribution contains programs for conversion to the TeX pk format and the Adobe/X11 BDF format. Similar utilities for Your Favourite Bitmap Format should not be difficult to write.

Copyright 1998-1999 by Juliusz Chroboczek

documented on: 2006.04.23

Plans about supporting TrueType/Type42 fonts in dvips 

Date:  Thurs, Sep 1 2005 4:10 pm
Groups: linux.debian.bugs.dist, linux.debian.maint.tetex
> The problem is that I need to be able to mimic ttf2tfm's way of
> assigning character codes.  It messes them up, and I don't fully
> understand its algorithm due to its use of features present in
> freetype1 but not freetype2.  For example, do the following:
> % cp /xp/WINDOWS/Fonts/comic.ttf .
> % ttf2tfm comic.ttf -P 1 -E 0
> % echo 'comic comic.ttf Pid=1 Eid=0' > ttfonts.map
> % ttf2pk comic 300
> % tex testfont
> This is TeX, Version 3.141592 (Web2C 7.5.4)
> (/usr/local/texmf/tex/plain/base/testfont.tex
> Name of the font to test = comic
> Now type a test command (\help for help):)
> *\table\bye
> [1]
> Output written on testfont.dvi (1 page, 11184 bytes).
> Transcript written on testfont.log.
> % xdvi testfont
> Notice that 'A' (ascii '101) appears instead in position '041.
> And so on.

that's because your example is such - you did not ask to re-encode to some useful encoding. use the following instead:

cp .../comic.ttf .
cp .../cork.enc .
ttf2tfm comic.ttf -p cork.enc # some glyphs will not be found which is OK
echo 'comic   comic.ttf Encoding=cork.enc' > ttfonts.map
ttf2pk comic 300
 ...

Vladimir Volovich <v…@vsu.ru>

The No BS Guide To TeTeX Font Installation 

Synopsis 

Installing type1 and true type fonts in tetex-latex

  1. Converting True Type Fonts to Type1 for TeTeX / LaTeX

  2. Getting the Type1 fonts into TeX

The No BS Guide To TeTeX Font Installation 

Installing type1 and true type fonts in tetex-latex

http://www.panix.com/~elflord/unix/latex/no-bs.html was at http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html

Converting True Type Fonts to Type1 for TeTeX / LaTeX 

  1. Install ttf2pt1

  2. Run the ttf2pt1 utility on each of your true type fonts. If you are using the fonts for tex, you need to rename them. For example, if I am renaming the arial fonts for tex, I rename as follows:

    arial   farr8a
    arialbd farb8a
    ariali  farri8a
    arialbi farbi8a
    Arialn  farr8an

The first letter, f is the foundry. ( You can use f for all the fonts you add yourself. ) The second two are an abbreviation for the font name ( ar ). This is followed by the font weight ( r or b in this case ), then optionally a variant. In the case of true type fonts, the only variant you will encounter is i for italic. This is followed by the encoding scheme ( 8a ) and optionally an n to specify the font width.

So to generate the appropriate Type1 fonts from the arial fonts, you would issue the following commands:

ttf2pfa arial.ttf       farr8a
ttf2pfa arialbd.ttf     farb8a
ttf2pfa ariali.ttf      farri8a
ttf2pfa arialbi.ttf     farbi8a
ttf2pfa Arialn.ttf      farr8an

This should spit out a lot of .pfa and .afm files. The .pfa files are the fonts, the .afm files are the font metrics.

Getting the Type1 fonts into TeX 

Run fontinst 

Assuming you have the type1 fonts named correctly ( this is important ), you can prepare yourself to install them. To do this, use the fontinst utility:

latex `kpsewhich fontinst.sty` Then you need to tell fontinst to build a font by the name of your font family ( the first three letters of the font ) in the following manner:

\latinfamily{far}{}\bye

fontinst should spit out several .pl and .vpl files , as well as some font definition ( .fd ) files.

Convert the .pl and .vpl files to binary format 

To do this, you simply run the following commands:

for X in *.pl; do pltotf $X; done for X in *.vpl; do vptovf $X; done

This should generate one .tfm file for ever .pl file and one .vf file for every .vpl file.

The vpl, pl, and mtx files generated by fontinst can be deleted now.

rm *.vpl *.pl *.mtx

Configure dvips 

You need to edit your psfonts.map file to tell dvips about the new font. To find this file, issue the command

kpsewhich psfonts.map

Add lines to it that look something like this:

farr8r          ArialMT <8r.enc <farr8a.pfa
farbi8r         Arial_BoldItalicMT <8r.enc <farbi8a.pfa
farb8r          Arial_BoldMT <8r.enc <farb8a.pfa
farri8r         Arial_ItalicMT <8r.enc <farri8a.pfa
farr8rn         Arial_Narrow <8r.enc <farr8an.pfa

You will need to add one line to it for each pfa file ( ie each type1 font in your font family ). The first row is same as the full name of the font, but with 8a replaced by 8r. The second column is the name of the font. It is essential to get this right !!! To find out the name of the font, look in the corresponding .afm file.

Test it 

\documentclass{article}
\begin{document}
\usefont{T1}{far}{m}{n}\selectfont
\huge
Testing a new font \dots the quick red fox jumped over the lazy brown dogs

\end{document}

There are a number of possibilities that you can try in the usefont command weight/shape. To see what other shapes/weights are available, look in the .fd file.

Note In my experience, a lot of the “backyard” public domain Type1 fonts don't work. Don't waste your time with things that don't work. I recommend that you start out with true type fonts from relatively respectable sources ( Adobe, Bitstream, Monotype and Microsoft ). These shouldn't give you any trouble. For example, the Arial font worked like charm for me. Start with something that has a good chance of working, this is difficult enough to do right without you having to worry about whether the font will work or not.

Install it System Wide 

Now you can install it system wide. Your best bet is to look around your tex installation to find out where your fonts are installed. On my tetex installation, I have this setup:

/usr/share/texmf/fonts/type1 : type1 fonts ( ie pfa files )
/usr/share/texmf/fonts/tfm : tfm files
/usr/share/texmf/fonts/vf : vf files
/usr/share/texmf/tex/latex/psnfss : .fd files and .sty files

The tex root directory may vary ( replace /usr/share/texmf with your tex root directory ). You should make appropriate subdirectories under these directories, and place the files in them.

You may also wish to make some of your own .sty files to act as a more “user friendly” front end to font selection. Look at some of the existing *.sty files in your psnfss directory for inspiration

documented on: 2008-06-21

Fonts and LaTeX 

Newsgroups: comp.text.tex

So, I tried to install this True type font called Papyrus.

I followed this instructions: http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html

There is however inconsistency on this page. They said you should use ttf2ps1, but then they show examples with ttf2pfa. In any case, I used ttf2ps1:

ttf2ps1 -b papyrus.ttf fpar8a

this created a bunch of files then I said:

latex `kpsewhich fontinst.sty`
* \latinfamily{far}{}\bye

This generated some more files. I did then:

for X in *.pl; do pltotf $X; done
for X in *.vpl; do vptovf $X; done
rm *.vpl *.pl *.mtx

And I added this line to psfonts.map:

fpar8a Papyrus-Regular <8r.enc <fpar8a.pfb

Then I tried this example:

\documentclass{article}
\begin{document}
\usefont{T1}{fpa}{m}{n}\selectfont
\huge
Testing a new font \dots the quick red fox jumped over the lazy brown dogs
\end{document}

The result was:

...
LaTeX Font Warning: Font shape `T1/fpa/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 3.
...

So I copyed files to directoryes:

/usr/share/fonts/afms/adobe/fpar8a.afm
/usr/share/texmf/fonts/afm/adobe/papyrus/fpar8a.afm
/usr/share/texmf/fonts/type1/adobe/papyrus/fpar8a.pfb
/usr/share/texmf/fonts/vf/adobe/papyrus/fpar7t.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fpar8c.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fpar8t.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fparc7t.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fparc8t.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fparo7t.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fparo8c.vf
/usr/share/texmf/fonts/vf/adobe/papyrus/fparo8t.vf
/usr/share/texmf/tex/latex/psnfss/8rfpa.fd

Andy

Fonts and LaTeX 

> Have you updated your filename database ?  If not, try
> that first (IIRC the command is texhash if you're using
> TeXLive or teTeX).

I didn't test if this does the trick, but I know that restarting of computer does.

Andy

Unicode text with Pdflatex 

http://tclab.kaist.ac.kr/ipe/pdftex_2.html

Otfried Cheong

You have probably just added a Truetype font to your Pdflatex installation, and this font probably contains many glyphs not accessible through the standard TeX encoding. Here are instructions that allow you to set things up so that you can use UTF-8 encoded Unicode text in your source file. Any non-ASCII character will by typeset using a Truetype font. You can have several such fonts and switch between them, as you would switch between other LaTeX fonts.

Note this is a rather weak form of Unicode support. Characters are simply mapped to a glyph in the font, using the font's Unicode character map. No special treatment is given to combining characters, spacing, or bidirectional rendering. If you want to write long stretches of text in, say, Japanese or Chinese, you may rather want to look at the CJK package. If you want to use it to typeset German, Greek or Russian, be warned that hyphenation will not work with this approach proposed here. It does have the advantage of being very lightweight, easy to set up for your favorite fonts, handling any script supported by your fonts, and being sufficient for many applications, such as including personal or geographic names or bibliographic references in the original script in your documents.

We will now use the Truetype font cyberbit.ttf to render all Unicode characters in our document. The same instructions should work for any font that includes a Unicode character map. You will need version 1.5 of the ttf2tfm tool, supporting the -w option. We assume familiarity with the explanations of the previous section about adding files to your LaTeX installation.

First, put the files utf8ttf.def and ttfucs.sty on . . .

documented on: 2008-06-21