Skip to content

fontlabapp.studios.anchor_studio.session

session

Anchor Studio state: native layer reads, anchor plans and one-step writes.

What: Studio keeps the glyph list, the preview master and the last plan. plan reads each named glyph's explicit layer on the chosen masters (flGlyph.findLayer; never fgGlyph), snapshots its anchors into model.Facts and runs a planner. Missing, auto, empty-planner and hinted layers are skipped with a note. apply builds every native pin first, then writes all pending layers through AppShell.history as one "Anchor Studio: <action> <subject>" Undo step on those explicit layers, reads every layer back and checks it with model.verify: a move beyond model.TOLERANCE or a sub-unit move that FontLab rounded to no change is reported as "Partly applied", never as success (Scriptmix TODO:78). Why: Contract §1.3/§1.4. Hinted layers stay refused until the user runs "Remove PostScript hints", the shared Issue 241 remover (fontui.remove_hints). Read-only paths (plan, census, cloud, rings, optical) never open history. Used by fontlabapp.studios.anchor_studio.tabs.

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
AUTO_NOTE attribute
HINT_NOTE attribute
MISSING_NOTE attribute (shared captured text)
NO_FONT attribute (shared captured text)
NO_GLYPHS attribute
ROUNDING_NOTE attribute (shared captured text)
facts_of function (layer: Any) -> Facts
layer_rings function (layer: Any) -> list[list[tuple[float, float]]] Closed polygons of the outline with component transforms (PythonQt <code>QPolygonF</code> is read by index).
new_pin function (name: str, x: float, y: float) -> Any A native anchor pin with the name-derived appearance; built before history opens.
pins_of function (layer: Any) -> tuple[Pin, ...] The layer's anchors as <code>Pin</code> tuples, in native order.
point function (x: float, y: float) -> Any
prepare function (layer: Any, edits: Sequence[tuple]) -> list[tuple[str, Any, Any]] Native steps <code>(step, pin, value)</code><code> for </code><code>edits</code>; every pin and point exists before the write.
write function (layer: Any, steps: Sequence[tuple[str, Any, Any]]) -> None