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

NameTypeAccessDescription
font_typeFontTypeReadGets the font type.
font_namestrReadGets the font name.
font_familystrReadGets the font family.
font_stylestrReadGets the font style.
num_glyphsintReadGets the num glyphs.
metricsFontMetricsReadGets the metrics.
encodingFontEncodingReadGets the encoding.
glyph_accessorGlyphAccessorReadGets the glyph accessor.

méthodes

SignatureDescription
__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: FontTypeNone)bytes`
font_type()FontTypeReturns the FontType enum value that identifies the font’s format
font_name()strCalls font_name on this Type1Font instance.
font_family()strProperty stores the family name of the font
font_style()strReturns the style descriptor (e.g., Bold, Italic) of the font
num_glyphs()intProperty gives the total count of glyphs in the font
metrics()FontMetricsProperty provides access to the FontMetrics object for the font
encoding()FontEncodingReturns a FontEncoding object that describes the font’s character encoding
glyph_accessor()GlyphAccessorReturns 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)FontCalls convert on this Type1Font instance.

Voir aussi

  • Aspose.Font — référence API d’entreprise
 Français