3.1.3.5. FontMap

This module handles font map files.

A font map file gives the correspondance between the TeX PK fonts and their PostScript equivalents. These files use the .map extension.

For example, the file pdftex.map contains lines like this one:

futbo8r Utopia-Bold ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <putb8a.pfb

Each line describes a PK font using the following format:

PK_FONT_NAME PS_FONT_NAME "PostScript snippet" <FILE_NAME1 <FILE_NAME2

The first word is the TeX font name and the second word is the PostScript font name. The PostScript font name can be omitted if it is the same than for TeX. The word starting by “<” are filenames to be included in the PostScript file. A filename with the extension .enc is an encoding file and a filename with the extension .pfb is a Printer Font Binary file. The text enclosed by double quotes is optional and gives a PostScript snippet to be inserted in the PostScript file. It can be placed at the end of the line.

The percent character is used for comment as for TeX.

References:

  • The Font Installation Guide Using Postscript fonts to their full potential with Latex. Originally written by Philipp Lehman. December 2004. Revision 2.14. cf. Creating map files Part. http://www.ctan.org/tex-archive/info/Type1fonts/fontinstallationguide
  • updmap(1) - Update font map files for TeX output drivers.
  • updmap.cfg(5) - Configuration of font mapping/inclusion for dvips and friends

To parse the font map pdftex.map do:

font_map = FontMap('/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map')

Each entry is stored in a FontMapEntry instance and can be retrieved using its TeX name as key:

font_map_entry = font_map['futbo8r']

The .pfb file name and the other parameters are stored as attributes:

>>> font_map_entry.pfb_filename
'putb8a.pfb'
class PyDvi.Font.FontMap.FontMap(filename)[source]

Bases: object

This class parses a font map file.

static _parse_effects(ps_snippet)[source]

Parse the PostScript snippet.

_parse_line(line)[source]

Parse a line.

_register_entry(font_map_entry)[source]

Register a font map entry.

print_summary()[source]
class PyDvi.Font.FontMap.FontMapEntry(tex_name, ps_font_name, ps_snippet, effects, encoding, pfb_filename)[source]

Bases: object

This class encapsulates a font map entry.

Public attributes:

tex_name

ps_font_name

ps_snippet

effects

encoding

pfb_filename

print_summary()[source]

Previous topic

3.1.3.4. FontManager

Next topic

3.1.3.6. PkFont

This Page