fontlabapp.fontui.outline_routes.retract_handles
retract_handles
Retract cubic handles onto their attached on-curve nodes.
What: Retract every cubic handle, or only handles attached to selected on-curve nodes, in selected glyphs on chosen masters. Node counts and types stay. How: Resolve handles per segment, including the closing segment. Open contours do not wrap. Quadratic contours and shared or transformed outlines are kept. Why: Zero-length handles can prepare curves for deliberate corner edits. Use: Select glyphs or on-curve nodes. Choose the node filter, inspect the table, then press Retract. The change is recorded as one Undo step. Benefit: Exact, repeatable retraction over many glyphs and masters. Automatic layers are kept; leave the automatic-base consent off to keep their bases too.
Independent behaviour rewrite after Pedro Arilla, glyphs-scripts, Paths/Make zero handles selected glyphs.py and Make zero handles selected nodes.py, Apache-2.0. Repository: https://github.com/pedroarilla/glyphs-scripts . No source code copied. Per-contour indexing also handles open ends correctly.
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 |
|---|---|---|---|
KEY |
attribute | ||
TITLE |
attribute | ||
changes |
function | (layer: Any, selected_only: bool, reference: Any=None) -> list[writer.Change] |
Preview the number of handles that actually move in each contour. |
main |
function | () -> Any |
Open the reusable non-modal retraction panel. |
moves |
function | (contour: Any, selected_only: bool, selected_indices: set[int] | None=None) -> list[tuple[Any, float, float]] |
Return changed handles and exact targets for well-formed cubic segments. |