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:
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'