Skip to content

fontlabapp.studios.mark_attachment.cursive

cursive

Cursive tab (Scriptmix Auto Cursive Attachment Get Sample and Add Anchors).

Get sample: one selected body layer with entry/exit anchors inside closed ink is measured (measure_sample) and saved as a NEW fontlab-cursive-sample-1 JSON file (an existing file is never overwritten; default folder: home). The format is the originals', so the old and the new tool read each other's samples. It writes nothing to the font.

Add anchors: the sample (same master only) fits the missing exit (ini, med) and entry (fin, med) anchors of the selected glyphs on the current master: 10–500 unit ink spans near the connection edge, scored by thickness and boundary angle, rounded half up (choose_attachment, cursive_changes; unchanged). A layer that cannot be fitted becomes a note row. Apply writes the listed anchors as one Mark Attachment: add cursive anchors <subject> Undo step.

The originals import fly.ap.anchors.writer inside two functions; here that name is the reused backend (anchor_writer below), the only change.

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
FILTER attribute
Point attribute (shared captured text)
Rings attribute
TITLE attribute
anchor_writer attribute
choose_attachment function (rings: Rings, profile: dict[str, float], candidates: list[float]) -> Point Pick the first minimum of thickness and undirected boundary-angle errors.
cursive_changes function (glyph: Any, layer: Any, profile: dict[str, float]) -> list[Any] Plan missing connections only, with deterministic near-edge searches.
measure_sample function (rings: Rings, points: list[Point]) -> dict[str, float] Average thickness fractions and boundary tangents around entry/exit pins.
needed_connections function (name: str) -> list[str] Retain the source tool's form-name routing without Unicode guesses.
outline_rings function (layer: Any) -> Rings Flatten transformed, closed outline shapes; keep contour winding and holes.
read_sample function (path: str, master: str, conversions: list[str] | None=None) -> dict[str, float] Load a portable profile; reject text loss, wrong format and master mismatch.
sample_document function (layer: Any, master: str) -> dict[str, Any] Capture the two named connection pins and package the portable profile.
save_document function (path: str, document: dict[str, Any]) -> None Write a new UTF-8 file; leave any existing file untouched.
validate_profile function (data: Any) -> dict[str, float] Require a finite, nonnegative thickness profile and two tangent angles.
vertical_spans function (rings: Rings, x: float) -> list[tuple[float, float, float, float]] Return filled vertical spans and their boundary angles using nonzero winding.