CffFont
CffFont
Panoramica
CffFont è una classe in Aspose.Font FOSS per Python. Eredita da: Font.
CffFont.get_kern_pairs() restituisce un elenco di oggetti KernPair che rappresentano le regolazioni di kerning definite nel font.
Questa classe fornisce 14 metodi per lavorare con oggetti CffFont nei programmi Python. I metodi disponibili includono: __init__, convert, encoding, font_family, font_name, font_style, font_type, get_kern_pairs, glyph_accessor, metrics, num_glyphs, save, e 2 metodi aggiuntivi. Tutti i membri pubblici sono accessibili a qualsiasi applicazione Python dopo l’installazione del pacchetto Aspose.Font FOSS per Python. Proprietà: charset, charstrings, encoding, font_family, font_name, font_style, e 9 altre.
Proprietà
| Nome | Tipo | Accesso | Descrizione |
|---|---|---|---|
font_type | FontType | Lettura | Ottiene il tipo di font. |
font_name | str | Lettura | Ottiene il nome del font. |
font_family | str | Lettura | Restituisce la famiglia di caratteri. |
font_style | str | Lettura | Ottiene lo stile del carattere. |
num_glyphs | int | Lettura | Ottiene il numero di glifi. |
metrics | FontMetrics | Lettura | Ottiene le metriche. |
encoding | `` | Lettura | Ottiene la codifica. |
glyph_accessor | GlyphAccessor | Lettura | Ottiene l’accessor del glifo. |
top_dict | TopDict | Lettura | Ottiene il dizionario principale. |
private_dict | PrivateDict | Lettura | Ottiene il dizionario privato. |
charstrings | CffIndex | Lettura | Ottiene le charstrings. |
global_subrs | CffIndex | Lettura | Ottiene i subrs globali. |
local_subrs | CffIndex | Lettura | Ottiene i subrs locali. |
charset | CffCharset | Lettura | Ottiene il set di caratteri. |
string_index | CffIndex | Lettura | Ottiene l’indice della stringa. |
Metodi
| Firma | Descrizione |
|---|---|
__init__(data: bytes, top_dict: TopDict, private_dict: PrivateDict, charset: CffCharset, encoding: CffEncoding, charstrings: CffIndex, global_subrs: CffIndex, local_subrs: CffIndex, string_index: CffIndex) | Calls init su questa istanza CffFont. |
get_kern_pairs() → list[KernPair] | Restituisce le coppie di kern. |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | La proprietà fornisce il FontType del font CFF |
font_name() → str | Restituisce la stringa del nome del font |
font_family() → str | Restituisce il nome della famiglia del font |
font_style() → str | Restituisce il descrittore di stile (ad es., Regular, Bold) |
num_glyphs() → int | Restituisce il numero totale di glifi nel font |
metrics() → FontMetrics | Restituisce un oggetto FontMetrics contenente i dati metrici del font |
encoding() → FontEncoding | Restituisce un oggetto FontEncoding che descrive la codifica dei caratteri del font |
glyph_accessor() → GlyphAccessor | Restituisce un GlyphAccessor per accedere ai dati dei singoli glifi |
save(path: str) | Scrive il font nel percorso del filesystem specificato |
save_to_format(font_type: FontType, path: str) | Salva il font nel FontType fornito nel percorso specificato |
convert(target: FontType) → Font | Restituisce un nuovo oggetto Font istanziato nel formato di destinazione richiesto, consentendo la conversione in‑memory del formato prima del salvataggio |