Skip to content

fontlabapp.studios.component_studio.replace

replace

Replace tab (Replace Reference): replace the base glyph of matching components, keep their placement.

The original's rules are kept unchanged (users_of, matrix_of, replace_changes, replace_problem, ReplaceEditor): every component that refers to glyph X now refers to glyph Y; offset, scale, slant, name, note and lock stay, because the base name of the existing component is set in place and FontLab rebuilds it (nothing is deleted and re-created). A component is a red row, and the batch is refused, when the new glyph has no layer for that master, when the new glyph uses the edited glyph (it would show itself), or when the component shares its element data. "Glyphs": Selected glyphs (default) or Whole font; "Masters": current master (default) or all. Both name fields complete glyph names; the dry run waits 250 ms after the last key press. Apply writes the listed changes as one Component Studio: replace component reference <subject> Undo step, then reads every component back (base name and unchanged matrix). Auto layers are listed and kept; a glyph that owns auto layers or is a base of one is refused (no opt-in, as in the original).

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
DEBOUNCE_MS attribute
component_writer attribute (shared captured text)
matrix_of function (shape: Any) -> tuple[float, ...] The six transform numbers, to prove that the placement did not move.
replace_changes function (package: Any, glyph: Any, layer: Any, master: str, names: tuple[str, str], facts: history.AutoFacts) -> list… One row per component of old on the layer, with its block reason if any.
replace_problem function (package: Any, glyph: Any, shape: Any, master: str, new: str, facts: history.AutoFacts) -> str Why shape cannot show new, or "".
users_of function (facts: history.AutoFacts, name: str) -> set[str] Every glyph that shows name, directly or through other components.