Skip to content

fontlabapp.contours.writer · declarations 001

Back to fontlabapp.contours.writer

BASES_LABEL module-attribute

BASES_LABEL

COMPATIBLE_LABEL module-attribute

COMPATIBLE_LABEL

PLACES module-attribute

PLACES

Point module-attribute

Point

collect

collect(glyphs: Iterable[Any], masters: Iterable[str], planner: Planner, facts: AutoFacts, *, compatible: bool = False, all_masters: Iterable[str] = (), allow_bases: bool = False) -> Plan

Run planner on every chosen layer and return the Plan.

A glyph that the geometry policy refuses is listed and skipped as a whole: it owns an automatic layer, or it is a base of an automatic composite (unless allow_bases). FontLab rebuilds those composites and Undo does not restore them. With compatible, the planner also runs on the other masters, and a glyph whose structure edits would differ is held back.

fmt

fmt(value: float) -> str

Short number text with PLACES decimals: 700.0 -> 700, 12.254 -> 12.25.

held_back

held_back(planned: dict[str, tuple[Any, list[Change]]], chosen: list[str]) -> str

Why the structure edits of one glyph would break master compatibility, or "".

planned holds the rows of every master that has the glyph. The edits keep the masters compatible only when all masters get the same keys and every master with a key edit is in scope.

node_points

node_points(contour: Any) -> list[Point]

(x, y, on-curve) of every node, in stored order and shape coordinates.

note_rows

note_rows(notes: list[str]) -> list[Change]

One muted row per distinct note, with the number of shapes.

outline_shapes

outline_shapes(layer: Any) -> tuple[list[Any], list[str]]

Own contour shapes that a script may edit in place, and notes for the rest.

Kept: components (edit their base glyph instead); shared outline data (an edit would change every glyph that uses it, and those glyphs are not in the Undo step; components of this glyph do not count, see element_shared); shapes with scale, slant or rotation (lengths, areas and directions in stored coordinates differ from what you see). A plain move is allowed: the measures here do not change under a move.

require_safe

require_safe() -> None

Compatibility hook; the writer discloses queued ids through history.commit.

translation

translation(shape: Any) -> tuple[float, float] | None

(dx, dy) when the shape transform only moves; None for scale, slant or turn.