TtfFont
TtfFont
Panoramica
TtfFont è una classe in Aspose.Font FOSS per Python. Eredita da: Font.
TtfFont.save(path) scrive l’istanza corrente del font nel percorso del filesystem fornito nel suo formato nativo.
Questa classe fornisce 23 metodi per lavorare con oggetti TtfFont nei programmi Python. I metodi disponibili includono: __init__, available_naming_strategies, convert, encoding, font_family, font_name, font_style, font_type, get_axis, get_blob, get_kern_pairs, get_named_instance e 11 metodi aggiuntivi. Tutti i membri pubblici sono accessibili a qualsiasi applicazione Python dopo aver installato il pacchetto Aspose.Font FOSS per Python. Proprietà: axes, cff_font, encoding, font_family, font_name, font_style e 12 in più.
Proprietà
| Nome | Tipo | Accesso | Descrizione |
|---|---|---|---|
font_type | FontType | Lettura | Ottiene il tipo di carattere. |
font_name | str | Lettura | Ottiene il nome del font. |
font_family | str | Lettura | Ottiene la famiglia di caratteri. |
font_style | str | Lettura | Ottiene lo stile del font. |
num_glyphs | int | Lettura | Ottiene il numero di glifi. |
metrics | FontMetrics | Lettura | Restituisce le metriche. |
encoding | FontEncoding | Lettura | Ottiene la codifica. |
glyph_accessor | GlyphAccessor | Lettura | Ottiene l’accessore del glifo. |
ttf_tables | TtfTableSet | Lettura | Ottiene le tabelle ttf. |
cff_font | `` | Lettura | Ottiene il font cff. |
fvar | `“FvarTable | None”` | Lettura |
hvar | `“HvarTable | None”` | Lettura |
is_variable | bool | Lettura | Ottiene la variabile is. |
axes | "list[AxisRecord]" | Lettura | Restituisce gli assi. |
named_instances | "list[NamedInstance]" | Lettura | Ottiene le istanze nominate. |
variable_axes | list[VariableAxis] | Lettura | Ottiene gli assi variabili. |
variable_instances | list[VariableInstance] | Lettura | Ottiene le istanze variabili. |
smart_instancer | `` | Lettura | Ottiene lo smart instancer. |
Metodi
| Firma | Descrizione |
|---|---|
__init__(sfnt_data: bytes, tables: TtfTableSet, sfnt_version: int) | Calls init su questa istanza di TtfFont. |
get_blob(tag: str) → `bytes | None` |
get_table_bytes(tag: str) → bytes | Restituisce i byte della tabella TrueType specificata |
set_table_bytes(tag: str, data: bytes) | Imposta il valore dei byte della tabella. |
get_axis(tag: str) → `VariableAxis | None` |
| `get_named_instance(name: str, preferred_languages: str | tuple[str, …])→VariableInstance |
| `variable_presentation(preferred_languages: str | tuple[str, …], include_suggested_values: bool)→dict[str, object]` |
available_naming_strategies() → tuple[str, ...] | Restituisce una tupla degli identificatori delle strategie di naming supportate |
| `instantiate(coordinates: dict[str, float], naming_strategy: str, family_suffix: str | None, legacy_family_name: str |
| `preview_naming_policy(coordinates: dict[str, float], naming_strategy: str, family_suffix: str | None, legacy_family_name: str |
get_kern_pairs() → list[KernPair] | Restituisce le coppie di kern. |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | Restituisce l’enumerazione FontType del font corrente |
font_name() → str | La proprietà contiene la stringa del nome completo del font |
font_family() → str | La proprietà contiene il nome della famiglia |
font_style() → str | La proprietà contiene il nome dello stile |
num_glyphs() → int | La proprietà contiene il conteggio dei glifi |
metrics() → FontMetrics | Restituisce un oggetto FontMetrics con dati di dimensione e spaziatura |
encoding() → FontEncoding | Restituisce un oggetto FontEncoding che descrive la mappatura dei caratteri |
glyph_accessor() → GlyphAccessor | Restituisce un GlyphAccessor per operazioni di glifo a basso livello |
save(path: str) | ` scrive lo stato corrente di un font TrueType sul filesystem nella posizione specificata |
save_to_format(font_type: FontType, path: str) | Chiama save_to_format su questa istanza di TtfFont. |
convert(target: FontType) → Font | Restituisce un oggetto Font convertito nel FontType di destinazione |