Skip to content

fontlabapp.studios.layer_manager._use_master · declarations 001

Back to fontlabapp.studios.layer_manager._use_master

TITLE module-attribute

TITLE

apply_renames

apply_renames(tool: Any, jobs: Sequence[dict[str, Any]], title: str = TITLE) -> dict[str, Any] | None

Rename all planned layers in ONE Undo step; restore the names on failure (the original's).

The step goes through tool.shell.history titled title with every renamed layer as a target (None when refused).

candidates

candidates(glyphs: Sequence[Any], masters: Sequence[str]) -> list[str]

Sorted names of the body layers that belong to a master but are not its master layer.

mask_name_for

mask_name_for(layer_name: str, masters: Sequence[str]) -> str

Return the mask layer name FontLab expects for a body layer name.

A single-master font keeps the mask of its master layer as plain "mask". Every other layer uses "mask.".

plan_layers

plan_layers(package: Any, names: Sequence[str], layer_name: str, stamp: str) -> list[dict[str, Any]]

The original plan() for layer layer_name of each glyph in names that has it.

The per-layer checks and refusals are the original's, verbatim (the selection capture is replaced by the chosen layer name).

plan_swap

plan_swap(master: str, chosen: str, taken: Collection[str], stamp: str, masters: Sequence[str], masks: tuple[bool, bool]) -> list[tuple[str, str, str]]

Return renames [(role, old name, new name)] in a safe order.

master is the master layer name, chosen the layer to promote, taken all layer names of the glyph, masks tells if (master, chosen) own a mask. Raise ValueError when a new name would clash. Names are compared without case.