t1lib
Object-oriented interface to the t1lib Type1 font rasterizer.
This is the interface that should actually be used; _t1lib is the actual C extension which exposes the low-level interface.
Raised by primitive t1lib operations that fail.
The string value describes what went wrong.
Raised when a requested fontname is not recognized.
Raised when a font encoding file has a formatting error.
A bounding box.
All values are measured in character space units.
Return the height of the region.
Return the width of the region.
Metrics information derived from AFM data.
All values are measured in character space units.
The charpos vector contains values which represent the horizontal escapement of string[:i + 1], where i is an index into string.
A rasterized bitmap.
Initialize a Glyph instance.
See the t1lib documentation for information on the format of the bits field.
Return the height of the bitmap.
Character margin areas are not included.
Return the width of the bitmap.
Character margin areas are not included.
A font.
Instances of this class should not be created explicitly in user code.
Return true iff this font is a t1lib 'logical' font.
Return true iff this font is a t1lib 'physical' font.
Return sequence of all logical fonts generated from the physical font associated with this font.
Return the t1lib 'physical' font associated with this font.
Return the underline position of this font.
If no AFM data is available, return 0.
Return the underline thickness of this font.
If no AFM data is available, return 0.
Return the PostScript name for this font.
Return the PostScript name of a character in the current encoding.
Return the index of a character in the current encoding.
If the character is not present in the current encoding, a T1Error exception is raised.
Return the kerning for a character pair.
The value returned is measured in character space units. If no AFM data is available, 0 is returned.
Return the current encoding vector.
Change the encoding vector.
None
If the new encoding vector is different from the old vector, the bitmap cache is cleared.
Return the current extension factor for the font.
Change the extension of the font.
The new slant replaces the old extension; it is not a modifier. If the new extension factor is different from the old factor, the bitmap cache is cleared.
Return the current slant factor for the font.
Change the slant of the font.
The new slant replaces the old slant; it is not a modifier. If the new slant factor is different from the old facter, the bitmap cache is cleared.
Return a new logical font based on the same physical font as this font.
Delete all cached bitmaps for this font.
Attempt to free all memory used by this font.
If this is a physical font still referenced by any logical fonts, a T1Error exception will be raised.
Initialize a FontSetter instance.
0.0
0.0
0
1
Rasterize a single character.
Returns a Glyph instance.
Rasterize a string.
Returns a Glyph instance.
Return metrics information for a string.
Return the width of a string in character space units.
Return the bounding box for a string.
Returns a BBox instance.
Set the number of bits per pixel for the resulting glyphs.
If bpp is not 1, 8, 16, 24, or 32, ValueError is raised.
Return a glyph object for the specified information.
Clear bitmap cache in underlying t1lib.
Initialize the library.
0
Use of this function is only necessary to enable logging. In that case, this must be called before any other calls to this module have been made.
Add an entry to the t1lib.log file.
LOG_WARNING
The name of the calling function or method is determined automatically and cannot be supplied by the caller.
Set the level of severity at which log entries are written to the log.
Set the resolution of the output device in dots-per-inch.
Set the values used for each level of gray for anti-aliasing.
Each value is interpreted as an unsigned 32-bit integer. Long integers may be used.
Return a font object for a named font.
If the named font is not found, an UnknownFontError exception is raised. The fontname value is case-sensitive.
Font objects returned by this function will always refer to 'physical' fonts in t1lib terminology; logical fonts generated from the same physical base may exist.
Return an encoding vector read from a file.
If a string is passed in, it will be used as a filename and passed to open(), otherwise fp_or_filename will be treated as any file-like object and assumed to have a readline() method.
t1lib