Skip to content

fontlab_fontport.designspace_io · declarations 001

Back to fontlab_fontport.designspace_io

LOSSES module-attribute

LOSSES

export_designspace

export_designspace(backend, destination: str | Path, document: DesignSpaceDocument | None = None) -> tuple[Path, list[str]]

Export a backend's masters to destination; return the path and losses.

Without document the axes, master locations and instances come from Designspace.from_native(backend) (native package). The borrowed backend is only read.

write_designspace

write_designspace(font: Font, document: DesignSpaceDocument, destination: str | Path, master_kerning: dict | None = None) -> Path

Write destination (.designspace) and <stem>-<master>.ufo beside it.

master_kerning maps source names to their own kerning; sources missing from it get font.kerning. Every source name must be a layer of font. Nothing is overwritten and document is not modified. Returns the designspace path.