Woff2Font
Vue de l’ensemble
‘Woff2Font’ est une classe dans Aspose.FONT FOSS pour Python.
Woff2Font.to_bytes(font_type) sérialisera la phonture WOFF2 en un objet de bytes pour le type de font spécifié.
Cette classe fournit 14 méthodes pour travailler avec des objets Woff2Font dans les programmes Python. Les méthodologies disponibles comprennent: __init__, convert , ’encodage’, font_family ; font_name; Font_style : font-typeetget_kern_pairs . , glyph_accessor ! , métrique ، num_glyfs. , save ainsi que 2 méthode supplémentaires. Tous les membres publics sont accessibles à toute application Pythone après l’installation de l’Aspose.Fon FOSS pour le pack Pyathone. Propriétés : encodereux, font&families en font, fon_nameen font style, fonctionnalitéd' font type, type_de fontglifyaccesor, 4 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. |
metadata_xml | str | Read | Gets the metadata xml. |
inner_font | TtfFont | Read | Gets the inner font. |
méthodes
| Signature | Description |
|---|---|
__init__(inner: TtfFont, metadata_xml: str) | Calls init on this Woff2Font instance. |
get_kern_pairs() → list[KernPair] | Returns the kern pairs. |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | Returns the FontType of this Woff2Font instance |
font_name() → str | Calls font_name on this Woff2Font instance. |
font_family() → str | Property holds the font’s family name string |
font_style() → str | Property holds the font’s style descriptor string |
num_glyphs() → int | Property holds the total glyph count as an integer |
metrics() → FontMetrics | Returns a FontMetrics object containing the font’s metrics |
encoding() → FontEncoding | Property holds a FontEncoding instance describing the font’s encoding |
glyph_accessor() → GlyphAccessor | Property holds a GlyphAccessor for glyph operations |
save(path: str) | Calls save on this Woff2Font instance. |
save_to_format(font_type: FontType, path: str) | Calls save_to_format on this Woff2Font instance. |
convert(target: FontType) → Font | Returns a Font object in the requested target format, enabling conversion from a WOFF2 font to any other supported format such as TTF or OTF |
Voir aussi
- Aspose.Font — référence API d’entreprise