This module contains 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: |
|
---|
Initialize a Type-1 font. input can be either the file name of a pfb file or a 3-tuple of already-decoded Type-1 font parts.
parts
prop
transform(self, effects)
[source]
Transform the font by slanting or extending. effects should be a dict where effects['slant']
is the tangent of the angle that the font is to be slanted to the right (so negative values slant to the left) and effects['extend']
is the multiplier by which the font is to be extended (so values less than 1.0 condense). Returns a new Type1Font
object.
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.1.1/api/type1font.html