Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Installing a new font: PFM, PFB

639 views
Skip to first unread message

Elisabeth Baker

unread,
Nov 27, 2001, 7:02:31 AM11/27/01
to
Greetings,

I have a couple of new fonts that I want to install in my LaTeX environment
on UNIX. I've been reading around the web to find out how, and think maybe
you can help:

I have files in the following directories:
.../texmf/fonts/pfm/adobe/xx/XXBI____.PFM
.../texmf/fonts/pfm/adobe/xx/XXB_____.PFM
.../texmf/fonts/pfm/adobe/xx/XXI_____.PFM
.../texmf/fonts/pfm/adobe/xx/XXR_____.PFM
and
.../texmf/fonts/type1/adobe/xx/XXBI____.PFB
.../texmf/fonts/type1/adobe/xx/XXB_____.PFB
.../texmf/fonts/type1/adobe/xx/XXI_____.PFB
.../texmf/fonts/type1/adobe/xx/XX_____.PFB

Do I need to change the pfb files to pfa? pfm to tfm? What else do I need
to do, and how can I use the new fonts in a LaTeX document?

Thanks a million :)
Elisabeth


Thierry Bouche

unread,
Nov 27, 2001, 9:43:45 AM11/27/01
to
"Elisabeth Baker" <Elisabe...@aplac.com> writes:

First, look around on ctan fonts/psfonts/adobe whether there doesn't
already exist some TeX support for these fonts (or at Y&Y, or at an
other german site where quite many tex metrics for ps fonts seem to be
available, but whose url I forgot!)

If this doesn't work for you, become another font guru!


--
Thierry Bouche

Oscar Lazzarino

unread,
Nov 27, 2001, 11:27:59 AM11/27/01
to
Elisabeth Baker wrote:
>
> Greetings,
>
> I have a couple of new fonts that I want to install in my LaTeX environment
> on UNIX. I've been reading around the web to find out how, and think maybe
> you can help:
>
> I have files in the following directories:
> .../texmf/fonts/pfm/adobe/xx/XXBI____.PFM
> .../texmf/fonts/pfm/adobe/xx/XXB_____.PFM
> .../texmf/fonts/pfm/adobe/xx/XXI_____.PFM
> .../texmf/fonts/pfm/adobe/xx/XXR_____.PFM
> and
> .../texmf/fonts/type1/adobe/xx/XXBI____.PFB
> .../texmf/fonts/type1/adobe/xx/XXB_____.PFB
> .../texmf/fonts/type1/adobe/xx/XXI_____.PFB
> .../texmf/fonts/type1/adobe/xx/XX_____.PFB

Ok, this is going to be long... let's see

1) Put your pfb files into a temporary directory, say /var/tmp/xx/

2) cd /var/tmp/xx

3) looks like you don't have the matching .afm. Too bad, but you can
produce them. pfm2afm should do the job. If your tex distribution
doesn't include it, you can find it on CTAN, in
/fonts/utilities/pfm2afm/afm2pfm.zip (not a typo). Since you are working
on unix, you have to compile it (with "make") and install it somewhere.

4) you must rename all your .pfb and .afm files. The "correct" names are
to be found in .../texmf/fontname/adobe.map
Example: Times-Roman: mv tir_____.pfb ptmr8a.pfb
The first three letters (here "ptm") identify the font family. You will
use these to select your font in latex.

5) run fontinst, asking it to produce lots of files. For example, if
your font is Times, you do this:
tex fontinst.sty
\latinfamily{ptm}{} \end

6) convert all .pl files in .tfm files and all .vpl files in .vf files.
Assuming you have a bourne shell, do this:
for I in *.pl; do pltotf $I; done
for I in *.vpl; do vptovf $I; done

7) install some files:
all .tfm files go to texmf/fonts/tfm/xx
all .vf files go to texmf/fonts/vf/xx
all .pfa files go to texmf/fonts/afm
all .pfb files go to texmf/fonts/type1/xx
all .fd files go to texmf/tex/latex/xx
delelte all other files.

8) configure dvips: (we are almost done)
create a new file xxx.map. If you would install times, you should write
something like this
ptmr8r Times-Roman "TeXBase1Encoding ReEncodeFont" <8r.enc
ptmri8r Times-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc
etcetera.
Again, you can find the name (Times-Roman, Times-Italic, etc) in
fontname/adobe.map, and probably also in the .afm files.

9) edit texmf/dvips/config/updmap. Someware it has a
"modules=acrobat-ext-adobe-buildin.map acrobat-std-adobe-buildin.map
charter.map context.map......" (may vary).
Add xxx.map in the list.

10) run texmf/dvips/config/updmap

11) run texhash

12) you now can select your whole font family to be the default with
\renewcommand{\rmdefault}{xxx} (where xxx is ptm for times)

13) hope I didn't forget anything... ;-)

Oscar Lazzarino

PS. It would be nice if some native english speaker could write a small
latex-font-installation.howto...

(o- ---------- -o)
//\ Oscar Lazzarino /\\
V_/_ o...@cclinf.polito.it _\_V

Matthew Amster-Burton

unread,
Nov 27, 2001, 12:04:45 PM11/27/01
to
Oscar Lazzarino <o...@cclinf.polito.it> wrote in
news:3C03BF0F...@cclinf.polito.it:

> 3) looks like you don't have the matching .afm. Too bad, but you can
> produce them. pfm2afm should do the job. If your tex distribution
> doesn't include it, you can find it on CTAN, in
> /fonts/utilities/pfm2afm/afm2pfm.zip (not a typo). Since you are
> working on unix, you have to compile it (with "make") and install it
> somewhere.

I've had almost consistently bad luck with pfm2afm--the resulting AFMs
either don't work at all or have problems that are visible in the set type.
Luckly, if your fonts came from Adobe, you can download the real AFMs from
the Adobe FTP site:

ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles

Otherwise, Oscar's advice sounds like what I do. Installing fonts for use
with TeX is a pain, but it's worth it--don't get too discouraged.

Matthew

Karsten Wantia

unread,
Nov 27, 2001, 1:56:50 PM11/27/01
to
On 27 Nov 2001 15:43:45 +0100, Thierry Bouche
<Thierry...@ujf-grenoble.fr> wrote:

[...]

>First, look around on ctan fonts/psfonts/adobe whether there doesn't
>already exist some TeX support for these fonts (or at Y&Y, or at an
>other german site where quite many tex metrics for ps fonts seem to be
>available, but whose url I forgot!)

This is probably
http://home.vr-web.de/was/fonts.html


Karsten Wantia

Peter Flynn

unread,
Nov 27, 2001, 7:01:59 PM11/27/01
to Elisabeth Baker
Elisabeth Baker wrote:


I am appending the long post I made last March, which describes this
in detail for a manual install *without* using fontinst.

But it does require .AFM (Adobe Font Metric) files: if you have the
.PFMs, get the .AFMs instead (either from the foundry -- in this
case Adobe, I assume -- or with pfm2afm).

Please also note the final paragraph: if anyone has a solution,
mail me.

///Peter
--
Here goes:

>From: Peter Flynn <pe...@silmaril.ie>
>Newsgroups: comp.text.tex
>Subject: Re: Type 1 fonts and PDFLaTeX: I just don't understand
>Date: Sun, 04 Mar 2001 01:53:44 +0000
>Organization: Silmaril Consultants
>Lines: 216
>Message-ID: <3AA1A028...@silmaril.ie>
>References: <B6B1F5E0.5318%eli...@dot.net.au>
>NNTP-Posting-Host: h-airlock117.esatclear.ie
>Mime-Version: 1.0
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>X-Trace: dorito.esatclear.ie 983670832 31077 194.165.161.117 (4 Mar
2001 01:53:52 GMT)
>X-Complaints-To: ab...@esatclear.ie
>NNTP-Posting-Date: Sun, 4 Mar 2001 01:53:52 +0000 (UTC)
>X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686)
>X-Accept-Language: en


OK. This way has worked for me for years. WARNING - this is not
the official way (that's fontinst but I have never managed to
get it to work for me), and there is a recent problem (see end).

1. Make sure you have .afm and .pfb files for the font you want.
Let's call them foo.afm and foo.pfb in this example.

2. Find out or decide on the fontname to use inside LaTeX. Note
this is not the font family full name (eg "Baskerville") but
the Karl Berry shortened font name in the format fnnsseec
where f=foundry (eg m=monotype etc); nn=name (eg ba=baskerville)
ss=series (eg bi=bold italic); ee=encoding (eg 8a=default);
c=smallcaps flag (literal "c"). The fontname directory in a
full installation of LaTeX has files per foundry giving fully-
formed names like these for common fonts. Read the fontname doc
to find out how to make up your own. In this example we'll
call our font zork (Zfonts ORdinary Bookface [mythical]).
Fontnaming conventions let you leave off the defaults.

3. Decide on your encoding. This is what tripped me up the first
few times until someone pointed me at Y&Y's TeX'n'ASNI encoding
which (to me) seems to be the only one that includes the glyphs
I want where I want them. Your mileage may vary. Their encoding
is in texnansi.enc and is referred to as "LY1" within LaTeX.
You should find texnansi.enc in texmf/dvips/base. Copy it to
the temp directory where you're doing all this stuff.

4. Run afm2tfm on your .afm files like this:

afm2tfm foo.afm -v zorkly.vpl -p texnansi.enc rzorkly.afm >zork.id

This creates a virtual font encoded as LY1 with the "raw" data
in the .afm file (hence the "r" prefix). Many people will tell
you that virtual fonts are dead and that this is the wrong way
to do it, but no-one has ever shown me an alternative that
works, so I stick with it.

5. If you want a small caps variant faked up (perhaps because the
typeface family doesn't have a special small-caps font), repeat
the medicine like this:

afm2tfm foo.afm -V zorklyc.vpl -p texnansi.enc rzorkly.tfm >>zork.id

Note the capital V here, and yes it *does* overwrite the rzork.tfm
created in the first command. Let it.

6. Now turn the .vpl files into .vf and .tfm pairs

vptovf zorkly.vpl zorkly.vf zorkly.tfm
vptovf zorklyc.vpl zorklyc.vf zorklyc.tfm

7. Make directories to hold the files: the path may be different on
your machine (and will be in the form C:\something\... if you
use MS-Windows) but under texmf there should be a fonts
directory, and in there there should be afm, tfm, type1 and vf
subdirectories. Create a subdirectory for the foundry in each, and
within those, create a subdirectory for the typeface:

mkdir -p /usr/share/texmf/fonts/afm/zfonts/ordinary
mkdir -p /usr/share/texmf/fonts/tfm/zfonts/ordinary
mkdir -p /usr/share/texmf/fonts/type1/zfonts/ordinary
mkdir -p /usr/share/texmf/fonts/vf/zfonts/ordinary

(The -p is a Unix feature, it automatically creates any missing
intervening subdirectories. If your directory-making command
doesn't do this, you'll have to do it the slow way and make the
intervening [foundry] directories first.)

8. Copy the files to their rightful places:

cp *.afm /usr/share/texmf/fonts/afm/zfonts/ordinary/
cp *.tfm /usr/share/texmf/fonts/tfm/zfonts/ordinary/
cp *.pfb /usr/share/texmf/fonts/type1/zfonts/ordinary/
cp *.vf /usr/share/texmf/fonts/vf/zfonts/ordinary/

9. Make an entry in the dvips font map file for this foundry so that
printing will work. Canonically texmf/dvips/config/config.ps
should contain entries for each foundry's map file, in the form
p +zfonts.map
so the first time you use a font from a new foundry, create the
map file in that directory and add the p line to config.ps. The
alternative is to stuff everything into psfonts.map but that is
a bit unwieldy, and liable to get overwritten when you upgrade.
There is a updmap script which is supposed to take care of all
this but I haven't tried it. The font entries in zfonts.map itself
looks like this (one for raw, one for cooked, and each entry is
on a *single* line to itself, no wrapping):

rzorkly Ordinary-Blackface "TeXnANSIEncoding ReEncodeFont"
<texnansi.enc <foo.pfb
zorkly Ordinary-Blackface "TeXnANSIEncoding ReEncodeFont"
<texnansi.enc <foo.pfb

The long hyphenated name comes from zork.id which we created
way back when we ran afm2tfm. You should get this right, because
it's the "official" full name of the font.

10. Next, create a style file for the typeface: let's call it
foozork.sty and put it in texmf.local/tex/latex/faces or
somewhere similarly obvious. This contains:

% foozork - created from foo
\def\fileversion{1.0}
\def\filedate{2001/03/03}
\def\docdate{2001/03/03}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{foozork}[\filedate\space\fileversion\space Zfonts
Ordinary PSNFSS2e package]
\RequirePackage[LY1]{fontenc}
\renewcommand{\rmdefault}{zor}
\endinput

Note the argument to \ProvidesPackage must be the same as this
style file name, and the font family is now referred to as zor
in this example, being the foundry letter plus the font abbrev.
If this is a typewriter font, make that \rmdefault into \ttdefault.
If it's a sans-serif font, make it \sfdefault.

11. Last file to create is the font definition (.fd) file. These
are named eeefnn.fd by prepending the encoding abbreviation
to the foundry letter and fontname abbreviation, so our example
would be ly1zor.fd, and would contain:

\ProvidesFile{ly1zor.fd}[2001/03/03 manual font definitions for
LY1/zor.]
\DeclareFontFamily{LY1}{zor}{}
\DeclareFontShape{LY1}{zor}{k}{n}{<-> zorkly}{}
\DeclareFontShape{LY1}{zor}{k}{sc}{<-> zorklyc}{}

One \DeclareFontFamily. Then as many pairs (for normal and
smallcaps) as you converted fonts. The bits to watch are the
3rd (weight/width), 4th (shape), and 5th (fontspec) arguments to
\DeclareFontShape: the rest are static for each .fd file and
simply identify the encoding and the font family.

The codes to use are given on pp.190-91 of The LaTeX Companion
and should also be in texmf/fontnames/weight.map and width.map.
The rules for combining weight and width need care: RTFM.
Oddly, there seems to be no shape.map online, so here's what
the Companion says:

n normal (upright)
it italic
sl slanted
sc smallcaps
ui upright italic
ol outline

Add your own, I guess: I use cu for cursive (scripts), for
example. The default fontspec parameter above <-> means all
sizes come from the same font spec (remember if this was a
font with different design sizes like CM it would be more
complex). If you didn't create a smallcaps, then omit the
second entry here (and in the foundry .map file). If the
face has only a few variants, create the missing entries
for bold, italic, slanted, etc with the relevant weight
and width and shape values, but in the fontspec give the
substitution command: for example to make references to
sl (slanted) type use an existing italic, say

{<-> ssub * zor/m/it}

If you find the x-height of a font too big or too small to
sort well with another font you are using, you can specify
a factor in this argument instead: this example will shrink
the result to 80% or normal:

{<-> s * [0.8] zorkly}

12. Run your TeX indexer program. This came with your
installation and MUST be run every time you add or remove
or rename files in the texmf directories. The program is
variously called texhash, mktexlsr, configure, and other
things, or it may have been installed as an icon on your
desktop. Whatever it's called, you MUST now run it, or
LaTeX will not find any of your new font files!

Then \usepackage{foozork} in your LaTeX file to make it the
default font. To use the font incidentally instead of as
the default, you can say, eg

This is {\fontencoding{LY1}\fontfamily{zor}\selectfont ZORK}.

In this case you will need to add \usepackage[LY1]{fontenc}
to the preamble of your document, as the one provided in
zork.sty won't be used.

NOW...the bug. As I said, this has worked for years just fine.
Suddenly, when I installed TeX Live 5d, everything fell apart.
dvips and the previewer were objecting to the "lack" of an
entry in the foundry .map file, because *someone* has changed
the way these programs look for font names, so where I had
rzorkly they were taking rzo from the virtual font to be
the font family instead of zor, and therefore failing to
find the font entry. I don't know why this was done, and I
didn't see any discussion about it, but it's obviously too
late, and I'm sure it was done for a reason. The problem is
I don't have a solution for it until someone can explain
how to use Type1 fonts without using virtual font mechanisms
and the "r" prefix.

Happy hunting.

///Peter


Anthony Goreham

unread,
Nov 28, 2001, 5:20:44 AM11/28/01
to
Peter Flynn <pe...@silmaril.ie> wrote:

[ Nice explanation of how to install type 1 fonts snipped ]

> NOW...the bug. As I said, this has worked for years just fine.
> Suddenly, when I installed TeX Live 5d, everything fell apart.
> dvips and the previewer were objecting to the "lack" of an
> entry in the foundry .map file, because *someone* has changed
> the way these programs look for font names

Actually I think this is configurable; there is a setting in the file
mktex.cnf. (See MT_FEATURES, you don't want to have the option
"fontmaps" listed.) Maybe the default changed in the distro at some
point?

--
Anthony Goreham The Queen's College, Oxford OX1 4AW, UK

George N. White III

unread,
Nov 28, 2001, 1:29:11 PM11/28/01
to

One of the perltk programs with the latest ConTeXt is texfont.pl,
which automates installation of fonts and includes support for
fake caps and slanted variants. It generates .map files, .tfm
files and .vf files. Texfont.pl is still a beta version,
and doesn't create .sty files needed to use the generated
fonts with LaTeX.

--
George N. White III <gn...@acm.org> Bedford Institute of Oceanography

Elisabeth Baker

unread,
Nov 29, 2001, 11:02:35 AM11/29/01
to
Thanks a million -- I got such good and clear advice from the group! Two
new fonts are now installed and one of them is behaving perfectly! I have
another question about the other font, but I'll address it in a separate
message.

I'm very grateful. About an English how-to -- this does not contain all the
details about compiling and generating one file type from another, but it
gives a simple framework:

This summary applies to Sabon and Univers fonts. The font "utopia" makes a
good model to follow.
I am assured by what I read that Type1 fonts are the clearest and
best-looking for on-line and printed use.
-----------
Sabon and Univers include files in the following formats:
.pfm .pfb .tfm .vf .fd .afm

.pfm files can be placed
.../texmf/fonts/pfm/adobe/sabon/
.../texmf/fonts/pfm/adobe/univers/

.pfb files can be placed:
.../texmf/fonts/type1/adobe/sabon/
.../texmf/fonts/type1/adobe/univers/

.tfm files can be placed:
.../texmf/fonts/tfm/adobe/sabon/
.../texmf/fonts/tfm/adobe/univers/

.vf files can be placed:
.../texmf/fonts/vf/adobe/sabon/
.../texmf/fonts/vf/adobe/univers/

.fd files can be placed:
.../texmf/tex/latex/psnfss/

.afm files can be placed:
.../texmf/fonts/afm/adobe/sabon/
.../texmf/fonts/afm/adobe/univers/

-----------
To tell dvips how to print, if the file .../texmf/dvips/config/config.ps
already contains the lines:
% Configuration of postscript type 1 fonts:
p psfonts.map
then you do NOT need to (Method 1) use config.psb and config.pun or their
contents to point to the the files psb.map and pun.map.

Instead, (Method 2) the contents of psb.map and pun.map can be stuffed into
psfonts.map.

psbr8r Sabon-Roman "TeXBase1Encoding ReEncodeFont " <8r.enc <psbr8a.pfb
psbri8r Sabon-Italic "TeXBase1Encoding ReEncodeFont " <8r.enc <psbri8a.pfb
psbb8r Sabon-Bold "TeXBase1Encoding ReEncodeFont " <8r.enc <psbb8a.pfb
psbbi8r Sabon-BoldItalic "TeXBase1Encoding ReEncodeFont " <8r.enc
<psbbi8a.pfb
psbro8r Sabon-Roman " .167 SlantFont TeXBase1Encoding ReEncodeFont " <8r.enc
<psbr8a.pfb
psbbo8r Sabon-Bold " .167 SlantFont TeXBase1Encoding ReEncodeFont " <8r.enc
<psbb8a.pfb

punr8r Univers "TeXBase1Encoding ReEncodeFont " <8r.enc <punr8a.pfb
punro8r Univers-Oblique "TeXBase1Encoding ReEncodeFont " <8r.enc
<punro8a.pfb
punb8r Univers-Bold "TeXBase1Encoding ReEncodeFont " <8r.enc <punb8a.pfb
punbo8r Univers-BoldOblique "TeXBase1Encoding ReEncodeFont " <8r.enc
<punbo8a.pfb
punc8r Univers-Black "TeXBase1Encoding ReEncodeFont " <8r.enc <punc8a.pfb
punco8r Univers-BlackOblique "TeXBase1Encoding ReEncodeFont " <8r.enc
<punco8a.pfb
punl8r Univers-Light "TeXBase1Encoding ReEncodeFont " <8r.enc <punl8a.pfb
punlo8r Univers-LightOblique "TeXBase1Encoding ReEncodeFont " <8r.enc
<punlo8a.pfb

NOTE: There is a script updmap which should take care of all this, but I do
not know whether it uses the first method (using the four files) or the
second (using psfonts.map).
-----------
To update the tables that describe these fonts, run the TeX indexer program
that came with your installation (such as mktexlsr).
It must be run every time you add or remove or rename files in the texmf
directories.
-----------
Each typeface has its own LaTeX style file. These can also go in the
...texmf/ tree.
-----------
When you ship a PostScript file to someone else, they may not be able to
display the Sabon or Univers characters.
To make these displayable for them and to support conversion of the
PostScript to pdf via Adobe Distiller,
you must force dvips to include the font description, by a dvips command
line inclusion:

dvips -n0 -h c:/texmf/fonts/&&&/&&&f.pfb

Peter Flynn

unread,
Nov 29, 2001, 6:47:35 PM11/29/01
to Anthony Goreham
Anthony Goreham wrote:


> Actually I think this is configurable; there is a setting in the file
> mktex.cnf. (See MT_FEATURES, you don't want to have the option
> "fontmaps" listed.) Maybe the default changed in the distro at some
> point?


Wow. That would be cool. I'll go do some digging. Thanks.

///Peter

0 new messages