Skip to content

fontlabapp.studios.anchor_studio.model · declarations 002

Back to fontlabapp.studios.anchor_studio.model

rings_overlay

rings_overlay(pins: Sequence[Pin], size: int) -> Overlay

One ring per stacked anchor, each a little larger, so three coincident anchors show three rings.

round_changes

round_changes(facts: Facts, step: int, do_x: bool, do_y: bool, names: Sequence[str]) -> list[Change]

Round To Grid: snap the named anchors (every anchor when names is empty).

setter

setter(pins: Sequence[Pin], name: str, x: float, y: float) -> Change | None

The set change for name at (x, y); None when nothing moves.

snap

snap(value: float, step: int) -> int

Nearest multiple of step, halves upward: 15→20, −15→−10.

snap_changes

snap_changes(facts: Facts, names: Sequence[str], y: float) -> list[Change]

Snap To Metrics: move the named anchors vertically to y.

stacked

stacked(pins: Sequence[Pin]) -> list[list[Pin]]

Groups of anchors that lie less than STACK_DISTANCE apart (three coincident → one group of 3).

subject

subject(names: Sequence[str]) -> str

Undo-label subject: the glyph name, or "N glyphs" for several.

target_point

target_point(box: Box, edge: str, offset: float) -> tuple[int, int]

Centre of the box on edge ("top"/"bottom"), pushed out by offset.

target_x

target_x(facts: Facts, reference: str, fraction: float, angle: float, y: float) -> float | None

X on the reference line at height y; None for an empty ink box.

fraction 0 is the left edge, 1 the right edge. angle is the FontLab italic angle in degrees; the line leans right when it is negative. The advance line passes through the baseline, the ink line through the box centre.

verify

verify(where: str, before: Sequence[Pin], edits: Sequence[Edit], stored: Sequence[Pin]) -> list[str]

Problems after a write: missing/extra names, moves beyond TOLERANCE and swallowed moves.

For a "set" only a changed coordinate is checked (FontLab may round an untouched one). A move that FontLab rounded back to the old value is a problem: "x move 100 → 100.4 rounded to no change".