Skip to content

fontlabapp.studios.layer_manager.copy_masters

copy_masters

Copy between masters tab: the Scriptmix "Copy Layer Between Masters" (Scripts/Masters/).

For each selected glyph, replace the contours of the checked target master layers with repaired clones of the source master's contours; optionally move same-named anchors to the source positions and set the source advance width. Components of the targets stay. The planning functions are the original's, verbatim: auto layers, glyphs refused by the auto-glyph facts, locked layers, metrics links or expressions, a source without outline, duplicated anchor names and anchors that would move to 0, 0 (fl#8527) are listed and skipped. Copy plans again, refuses a plan that differs from the list, and writes every target layer as one Layer Manager: copy layers <subject> Undo step through AppShell.history, then reads contours, widths and anchors back.

Classes

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
LINK_FIELDS attribute (shared captured text)
MAX_NAMES attribute (shared captured text)
Move attribute (shared captured text)
TITLE attribute
clone_shape function (shape: Any) -> Any Return a repaired clone of <code>shape</code>. (shared captured text)
contour_copy attribute (shared captured text)
contours_in function (layer: Any) -> int Return the number of contours in the non-component shapes of <code>layer</code>. (shared captured text)
copy_pairs function (tool: Any, pairs: Sequence[Pair], title: str=TITLE) -> dict[str, Any] | None Write the planned pairs as ONE Undo step and read them back (the original's <code>copy&#95;pairs</code>).
has_metrics_link function (layer: Any) -> bool True when a sidebearing or the width holds a link or an expression. (shared captured text)
outline_shapes function (layer: Any) -> list[Any] Return the non-component shapes of <code>layer</code> that hold contours. (shared captured text)
plan_anchors function (source: Any, target: Any) -> tuple[tuple[Move, ...], tuple[str, ...], str] Return (moves, missing names, problem) for same-named anchors.
plan_pair function (glyph: Any, master: str, source: Any, target: Any, anchors: bool, width: bool, reason: str) -> Pair Plan one pair.
plural function (count: int, word: str) -> str Return "1 layer" or "2 layers". (shared captured text)
qt attribute (shared captured text)
replace_outline function (source: Any, target: Any) -> None Remove the non-component shapes of <code>target</code>; add clones of the source outline. (shared captured text)
survey function (package: Any, names: Sequence[str], source_master: str, targets: Sequence[str], anchors: bool, width: bool, … Plan every glyph and target master.