Type1Font
Vue de l’ensemble
‘Type1Font’ est une classe dans Aspose.FONT FOSS pour Python.
Type1Font.load_afm charge un fichier AFM de la route donnée dans l’instant Type1.
Cette classe fournit 15 méthodes pour travailler avec des objets Type1Font dans les programmes Python. Les méthodologies disponibles comprennent: __init__, convert , ’encodage’, font_family ; font_name; Font_type : get_kern_pairs: glyph_accessor.load_afm., metricset 3 autres méthode. Tous les membres publics sont accessibles à toute application Pythone après l'installation de l’Aspose.Fon FOSS pour le package PyThone. Propriétés :encoders, 'font-famili,, fonte_name`` style fonty_ytypt`glyfliffliftccessore, 2 plus.
Propriétés
| 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. |
méthodes
| 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` |
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. |
Voir aussi
- Aspose.Font — référence API d’entreprise