3.1.3.4. FontManager

This module implements a font manager for the DVI machine.

Each time a font is loaded, the font manager attributes to the font an incremental identification number that corresponds to the font index in the DVI Machine.

The different type of fonts (Packed, Type 1, etc.) are handled by a subclass of the class PyDvi.Font.Font which provides a kind of plugin mechanism. In order to manage the mapping between the TeX and the Type 1 font name, the font manager constructor takes a font map as parameter.

To create a font manager instance using the “pdftex” font map do:

font_manager = FontManager('pdftex')

Then to load for example the “cmr10” font and get the font class instance do:

font = font_manager["cmr10"]

Latter the same piece of codes could be use to retrieve the font class instance.

To get the number of fonts in the font manager use the len() function:

len(font_manager)
class PyDvi.Font.FontManager.FontManager(font_map, use_pk=False)[source]

Bases: object

This class implements a font manager for the DVI machine.

The parameter font_map specifies the name of a font map.

_extension_to_font_class = {'pk': <class 'PyDvi.Font.PkFont.PkFont'>, 'pfb': <class 'PyDvi.Font.Type1Font.Type1Font'>, 'vf': <class 'PyDvi.Font.VirtualFont.VirtualFont'>}
_font_classes = [<class 'PyDvi.Font.PkFont.PkFont'>, <class 'PyDvi.Font.VirtualFont.VirtualFont'>, <class 'PyDvi.Font.Type1Font.Type1Font'>]
_get_font_class_by_filename(filename)
_get_new_font_id()[source]

Return a new font id.

_load_font(font_type, font_name)[source]

Load the font font_name using the font_type plugin.

_load_font_map(font_map)

Load the font map.

_load_mapped_font(tex_font_name)
_load_virtual_font(tex_font_name)
_logger = <logging.Logger object at 0x4150e90>

Previous topic

3.1.3.3. Font

Next topic

3.1.3.5. FontMap

This Page