NameTable

Overview

NameTable is a class in Aspose.Font FOSS for Python.

NameTable.language_key returns a language tag string for the given platform_id and language_id.

This class provides 11 methods for working with NameTable objects in Python programs. Available methods include: best_name, ensure_english_platform_names, ensure_name_record, from_reader, get, language_key, localized_names, records_for, remove_name_ids, replace_name, to_bytes. All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package. Properties: records.

Properties

NameTypeAccessDescription
recordslist[NameRecord]Read/WriteGets or sets the records.

Methods

SignatureDescription
language_key(platform_id: int, language_id: int)strReturns a language tag string for the given platform_id and language_id
get(name_id: int, platform_id: int, encoding_id: int)str | Nonereturns the string value of a name record matching the given identifiers, orNone` if the record does not exist
records_for(name_id: int)list[NameRecord]Returns a list of NameRecord objects that have the given name_id
localized_names(name_id: int)dict[str, str]Returns a dict mapping language tags to name strings for the given name_id
best_name(name_id: int, preferred_languages: tuple[str, ...])str | NoneSelects the most appropriate name string for name_id based on preferred_languages, or None
replace_name(name_id: int, value: str)Overwrites all records of the given name_id with the supplied value
ensure_name_record(name_id: int, value: str, platform_id: int, encoding_id: int, language_id: int)Creates or updates a name record with the specified IDs and value
ensure_english_platform_names(name_id: int, value: str)Guarantees English platform records for name_id with the given value
remove_name_ids(name_ids: Iterable[int])Deletes all name records whose name_id appears in the provided iterable
from_reader(r: BinaryReader, table_length: int)"NameTable"Reads a NameTable from a BinaryReader using the given table_length
to_bytes()bytesSerializes the NameTable into its binary representation

See Also