Skip to content

fontlabapp.fontui.superaligner

superaligner

Align contour start nodes and directions to the first declared master.

What: Align contour start nodes and directions to the first declared master. How: Compare normalized point geometry among cyclic point-type matches in both directions. Choose the unique closest order; keep a glyph when scores tie. Read back the actual point coordinates, start and winding after each write. Why: Repair master point ordering before interpolation. Use: Choose All masters, inspect the start and direction changes, then Apply. Benefit: Adds a batch preview to start-node and direction commands.

The non-modal panel previews the selected glyphs and chosen masters. A glyph with shared, scaled or rotated outline shapes is kept as a whole. Automatic-layer owners are kept. Bases of automatic composites are kept unless the shared consent option is enabled. Each Apply is recorded as one Undo step through the App history writer. Reload after changing the selection.

Independent behaviour rewrite after Simon Cozens, GlyphsScripts/Superaligner.py, MIT, copyright 2017 Simon Cozens. Repository: https://github.com/simoncozens/GlyphsScripts . No source code was copied.

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
alignment function (reference: list[writer.Point], candidate: list[writer.Point]) -> tuple[bool, int] Choose the unique nearest geometry among both cyclic point-type orders.
changes function (glyph: Any, master: str, layer: Any, masters: list[str]) -> list[writer.Change] Keep a whole unsuitable glyph while other glyphs remain writable.
contours function (layer: Any) -> list[Any] Read editable contours; refuse omitted shapes for cross-master mapping. (shared captured text)
main function () -> Any Open one non-modal panel; replace an earlier panel of the same tool. (shared captured text)
normalized function (points: list[writer.Point]) -> list[tuple[float, float]] Remove translation and axis scale before comparing master geometry.
plan_content function (glyph: Any, master: str, layer: Any, reference: str) -> list[writer.Change] Match contour order to the first declared master; refuse incomplete pairs.
spans function (contour: Any) -> list[list[Any]] Read complete line or cubic spans; refuse quadratic and open contours. (shared captured text)