[pdftex] Multiple encodings for one font in pdftex.map

Jouni K. Seppänen jks at iki.fi
Sun Feb 27 10:26:36 CET 2011


I am one of the maintainers of Matplotlib (a Python library for making
plots in a way similar to Matlab). One of its features is that it can
parse dvi files and embed their contents in its output (which can be
pdf, or a number of other formats), so that those users who are
embedding plots in TeX documents can set text strings using TeX and
match the style of the document exactly.

Now dvi files include references to TeX fonts, so we need a mapping from
TeX fonts to fonts that can be embedded in pdf files (or used to draw on
a bitmap). When implementing this feature I decided to reuse pdftex.map,
since it is present in pretty much all modern TeX implementations and is
well documented in the PDFTeX manual. The manual specifies the following
format for lines in the map file:

tfmname basename fontflags special encodingfile fontfile

It further says that the three last fields can be in any order, and that
the encodingfile field can be left out, but it does not say that there
can be multiple encodingfile fields on one line. I added an assert in my
code requiring there to be at most one of them.

Some users are reporting that TeX Live 2010 installs a pdftex.map file
that causes this assertion to fail:

http://thread.gmane.org/gmane.comp.python.matplotlib.general/26250

In this case, pdftex.map file included the line

pbkdo8y URWBookmanL-DemiBold ".167 SlantFont TeXnANSIEncoding ReEncodeFont" <texnansi.enc <8r.enc <ubkd8a.pfb

My questions are:

1) Is this a bug in TeX Live, or whichever program that caused this line
to be written to pdftex.map?

2) What does PDFTeX do given this line? Does it e.g. simply choose one
of the encoding files and apply that, or does it look into the encoding
files and decide that since TeXnANSIEncoding was specified in pdftex.map
and texnansi.enc defines an encoding by that name (and 8r.enc defines
one named TeXBase1Encoding), texnansi.enc should be used?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks



More information about the pdftex mailing list