Skip to content

fontlabapp.studios.align_nudge.model

model

Pure planners of Align & Nudge: align/distribute, interpolated nudge, overlap nodes, simplify.

What: each planner reads a transform_studio.geometry.Layer snapshot and returns Change rows whose edit holds snapshot steps (("node", …), ("shape", …), ("remove", …)), or a skip note string. Nothing here touches FontLab, so every rule is tested without the host. Why: behaviour parity with the Scriptmix Scripts/Contours tools Align And Distribute, Interpolated Nudge, Overlap Nodes and Simplify Selected Nodes, whose behaviour is restated in each function's docstring.

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
CONFLICT attribute
COORDINATE_RANGE attribute
COUNTS attribute
DISTRIBUTE_ALL attribute
FINITE_RANGE attribute
GEOMETRY attribute
Group attribute
ITALIC_ERROR attribute
NUDGE_DEFAULT attribute
NUDGE_EMPTY attribute
NUDGE_FINITE attribute
NUDGE_RANGE attribute
NUDGE_SELECT attribute
OPERATIONS attribute (shared captured text)
REFERENCES attribute
STRUCTURE attribute
TWO_OWNERS attribute
XY attribute (shared captured text)
align_changes function (layer: Layer, mode: str, all_nodes: bool=False, coordinate: float | None=None) -> list[Change] Align And Distribute <code>plan&#95;layer</code>: align to the bounds or a coordinate, or distribute nodes.
component_groups function (layer: Layer) -> tuple[list[Group], list[Change]] Selected component rectangles; their base outlines are never edited.
contour_groups function (layer: Layer, s: int, c: int, all_nodes: bool, distribute: bool) -> list[Group] Pair each selected on-curve node with its unselected adjacent controls (whole contours move as units).
group_steps function (layer: Layer, group: Group, dx: float, dy: float) -> tuple
node_groups function (layer: Layer, all_nodes: bool, distribute: bool) -> tuple[list[Group], list[Change]]
nudge_changes function (layer: Layer, dx: float, dy: float) -> list[Change] Interpolated Nudge: one row per closed cubic contour with selected on-curve nodes.
nudged function (points: Sequence[tuple[float, float, bool]], selected: set[int], dx: float, dy: float) -> list[XY] Scale cubic handles between simultaneously moved endpoints; factors clamp to 0…4 per axis.
outline_shapes function (layer: Layer) -> tuple[list[int], list[str]] Indices of own contour shapes editable in place, and notes for shared or scaled/rotated ones.
overlap_changes function (layer: Layer, angle: float) -> list[Change] Overlap Nodes: move each selected tip's adjacent corner onto it and align the next handle.
position function (points: Sequence[XY], axis: int, fraction: float) -> float
removals function (contour: Contour, selected: Sequence[int] | None=None) -> list[int] Alternate selected indices of a polygon; open endpoints stay; closed keep ≥ 3 nodes, open ≥ 2.
simplify_changes function (layer: Layer, reference: Layer | None=None) -> list[Change] Simplify Selected Nodes: remove alternate selected nodes, using the reference (preview master) selection.