Type1Font
Overview
Type1Font is a class in Aspose.Font FOSS for Python.
Inherits from: Font.
Type1Font.load_afm loads an AFM file from the given path into the Type1Font instance.
This class provides 15 methods for working with Type1Font objects in Python programs.
Available methods include: __init__, convert, encoding, font_family, font_name, font_style, font_type, get_kern_pairs, glyph_accessor, load_afm, metrics, num_glyphs, and 3 additional methods.
All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package.
Properties: encoding, font_family, font_name, font_style, font_type, glyph_accessor, and 2 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
font_type | FontType | Read | Gets the font type. |
font_name | str | Read | Gets the font name. |
font_family | str | Read | Gets the font family. |
font_style | str | Read | Gets the font style. |
num_glyphs | int | Read | Gets the num glyphs. |
metrics | FontMetrics | Read | Gets the metrics. |
encoding | FontEncoding | Read | Gets the encoding. |
glyph_accessor | GlyphAccessor | Read | Gets the glyph accessor. |
Methods
| Signature | Description |
|---|---|
__init__(raw_data: bytes, font_data: Type1FontData, is_pfa: bool) | Calls init on this Type1Font instance. |
get_kern_pairs() → list[KernPair] | Returns the kern pairs. |
load_afm(path: str) | Loads an AFM file from the given path into the Type1Font instance |
to_bytes(font_type: FontType | None) → bytes | Serializes the font to bytes, optionally using the specified FontType |
font_type() → FontType | Returns the FontType enum value that identifies the font’s format |
font_name() → str | Calls font_name on this Type1Font instance. |
font_family() → str | Property stores the family name of the font |
font_style() → str | Returns the style descriptor (e.g., Bold, Italic) of the font |
num_glyphs() → int | Property gives the total count of glyphs in the font |
metrics() → FontMetrics | Property provides access to the FontMetrics object for the font |
encoding() → FontEncoding | Returns a FontEncoding object that describes the font’s character encoding |
glyph_accessor() → GlyphAccessor | Returns a GlyphAccessor for retrieving glyph data from the font |
save(path: str) | Writes the font to the specified file path in its current format |
save_to_format(font_type: FontType, path: str) | Saves the font converted to the given FontType at the provided path |
convert(target: FontType) → Font | Calls convert on this Type1Font instance. |