Skip to content

fontlabapp.studios.derived_glyphs._component_sets

_component_sets

One component-set writer for Default figures and Unicase (Scriptmix TODO:84).

Scripts/Components/Set Default Figures.py and Make Lower Unicase.py carried identical copies of group_plan, validate_pairs, prepare and component_rows, and the same writer body (write_components in Set Default Figures, apply_pairs in Make Lower Unicase, which differs only in its replace_contours=True default). This module holds them once, verbatim from Set Default Figures (the tests compare every function with both originals by AST).

The writer validates every pair before any change (plain base layer per master, unlocked target layers, no auto target or base of an auto glyph, no circular component), creates missing targets with FontLab's Add Glyph (each its own step, through glyph_creation.create_glyphs), then replaces the targets' components (and, only when asked, contours and anchors), copies advances and kerning-class memberships in ONE history.commit step titled title, and reads every layer back. With replace_contours=False the target's own contours stay (the figures-default repair, Scriptmix TODO:16).

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
Pair attribute (shared captured text)
TITLE attribute
component_creation attribute
component_rows function (package: Any, rows: list[glyph_copies.Row], *, allow_rebuild: bool=False) -> list[glyph_copies.Row] List per-target refusals without discarding other eligible targets.
glyph_copies attribute
glyph_creation attribute
group_plan function (package: Any, pairs: list[Pair]) -> dict[str, dict[str, Any]] Give targets the same per-side class memberships as their bases.
prepare function (package: Any, pairs: list[Pair], *, allow_rebuild: bool=False) -> list[tuple[str, str, Any, float]] Build detached components through the App before the outline commit.
validate_pairs function (package: Any, pairs: list[Pair], *, facts: history.AutoFacts | None=None, allow_rebuild: bool=False) -> None Check masters, layer locks, automatic owners and component cycles.
write_components function (package: Any, pairs: list[Pair], *, title: str=TITLE, replace_contours: bool=False, clear_anchors: bool=True… Replace target components, widths and class memberships in one history batch.
writer attribute (shared captured text)