Skip to content

fontlabapp.fontui.teaching_writers.copy_layers_from_font

copy_layers_from_font

What: Copy layers from another open font to selected current-font glyphs. How: Map source and destination layer names. Preview and confirm Overwrite, Incoming + suffix, Destination + suffix or Mask. One Copy is recorded as one Undo step in the destination. Both fonts are identified by fgId. Why: Native Paste Special uses the clipboard; this repeats explicit layer maps without switching fonts. The source is read only and glyphs must already exist. Usage: Select destination glyphs in its Font window, choose a source, enter mappings, Preview, inspect kept rows, confirm, then Copy. Benefit: Transfer outlines, anchor positions and advances across many glyphs.

Components, hints, guides, metric expressions, locked/automatic layers and unsafe automatic dependants are kept. Element names, notes and transforms, contour names, node names and raw flags are retained; selection flags clear. Custom node/contour properties are refused. Anchor coordinates use App; existing pin styles stay, new pins use name-derived styles. Anchor expressions, layer metadata, links and colour marks are not copied. Units per em must match. Mask replaces the mapped layer's mask. Destination + suffix refuses master renames; existing suffix names are kept. New names cannot contain @ or # or begin with |temp|, mask, img. or bw.. Capture allows 3 seconds plus one second per selected glyph/mapping; a timeout refuses the whole preview. Apply rechecks the displayed plan. Partial failures direct you to Edit > Undo. Setup: FontLab 9, Python 3.11, Fly, App>=0.2.150.dev0. Independent behaviour rewrite of TR-CopyLayers.py, Vassil Kateliev / Karandash Type Foundry, kateliev/TypeRig, MPL-2.0. https://github.com/kateliev/TypeRig No upstream code, comments or assets copied. Implementation: Apache-2.0.

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
KEY attribute
MODES attribute
TITLE attribute
apply_plan function (plan: dict[str, Any], confirmed: bool) -> dict[str, Any] Recheck the visible plan and write one destination Undo step.
checked_name function (name: str) -> str Reject recipe, temporary and lossy text syntax before any write.
clone_shapes function (layer: Any) -> list[Any] Restore clone losses through contour_copy before history starts.
collision function (name: str, suffix: str, mode: str, exists: bool) -> tuple[str, str | None] Return the incoming name and optional destination backup name.
layer_data function (layer: Any, deadline: float) -> dict[str, Any] Snapshot each nodes() once; never use Python wrapper identity as a key.
main function () -> None Contain startup errors; the App guards owned signal callbacks.
make_plan function (source_id: int, destination_id: int, names: list[str], mappings: list[tuple[str, str]], mode: str, suffix: s… Run one destination dependency scan per explicit Preview.
panel_type function () -> type Build the non-modal mapping editor; only Preview and Copy scan dependencies.
registered_fonts function () -> dict[int, tuple[str, Any]] Read registered packages without activating or completing any source font.
resolve function (source_id: int, destination_id: int) -> tuple[Any, Any] Require two registered fonts, equal units per em and the current destination.
survey function (source: Any, destination: Any, names: list[str], mappings: list[tuple[str, str]], mode: str, suffix: str, fa… Keep every refused glyph/layer row; plan only the selected destination names.
usable function (layer: Any, *, source: bool) -> None Refuse content the copy cannot preserve, rather than silently dropping it.