FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

matplotlib.type1font — Matplotlib 3.5.2 documentation

matplotlib.type1font#

A class representing a Type 1 font.

This version reads pfa and pfb files and splits them for embedding in pdf files. It also supports SlantFont and ExtendFont transformations, similarly to pdfTeX and friends. There is no support yet for subsetting.

Usage:

>>> font = Type1Font(filename)
>>> clear_part, encrypted_part, finale = font.parts
>>> slanted_font = font.transform({'slant': 0.167})
>>> extended_font = font.transform({'extend': 1.2})

Sources:

class matplotlib.type1font.Type1Font(input)[source]#

Bases: object

A class representing a Type-1 font, for use by backends.

Attributes
partstuple

A 3-tuple of the cleartext part, the encrypted part, and the finale of zeros.

decryptedbytes

The decrypted form of parts[1].

propdict[str, Any]

A dictionary of font properties.

Initialize a Type-1 font.

Parameters
inputstr or 3-tuple

Either a pfb file name, or a 3-tuple of already-decoded Type-1 font parts.

decrypted#
parts#
prop#
transform(effects)[source]#

Return a new font that is slanted and/or extended.

Parameters
effectsdict

A dict with optional entries:

  • 'slant'float, default: 0

    Tangent of the angle that the font is to be slanted to the right. Negative values slant to the left.

  • 'extend'float, default: 1

    Scaling factor for the font width. Values less than 1 condense the glyphs.

Returns
Type1Font

Back | FazBrowse Home | New Git URL