Skip to content

fontlabapp.objects.json_data.Envelope

Envelope dataclass

One FontLab object JSON document: header values and the ordered items.

upm and package_id are None when the JSON omits them (FontLab still reads such data). items holds (kind, payload) pairs. extra keeps unknown top-level keys so a round trip loses nothing.

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
extra attribute tuple[tuple[str, Any], ...]
glyph_names function (self) -> tuple[str, ...] Return the names of the glyph items, in order.
items attribute tuple[Item, ...]
kinds function (self) -> tuple[str, ...] Return the kind of each item, in order.
package_id attribute int | None
parse function (cls, data: bytes | bytearray | str | Mapping[str, Any]) -> Envelope Read and check object JSON; raise <code>ValueError</code> with a plain reason.
replace_items function (self, items: Iterable[Item]) -> Envelope Return a copy with other items and the same header.
to_bytes function (self, indent: int | None=None) -> bytes Return UTF-8 JSON; <code>indent</code> pretty-prints it.
to_dict function (self) -> dict[str, Any] Return the JSON object: singleton key for one item, <code>objects</code> for more.
upm attribute int | None