Skip to content

fontlabapp.studios.transform_studio.geometry · declarations 001

Back to fontlabapp.studios.transform_studio.geometry

EPS module-attribute

EPS

MATRIX_TOLERANCE module-attribute

MATRIX_TOLERANCE

NODE_TOLERANCE module-attribute

NODE_TOLERANCE

ORIGIN_ERROR module-attribute

ORIGIN_ERROR

about

about(linear: Affine, ox: float, oy: float) -> Affine

linear applied around the point (ox, oy).

anchor_steps

anchor_steps(layer: Layer, matrix: Affine) -> tuple[list[tuple], str]

Anchor moves under matrix and the fl#8527 problem text (or "").

apply

apply(m: Affine, x: float, y: float) -> tuple[float, float]

concat

concat(first: Affine, then: Affine) -> Affine

first followed by then (Qt first * then).

corners

corners(shape: Shape) -> list[tuple[float, float]]

finite

finite(*values: float) -> bool

ghost

ghost(layer: Layer) -> Overlay

The layer's own outlines in glyph space as a TGlyph overlay (components are not drawn).

glyph_points

glyph_points(shape: Shape) -> list[tuple[float, float]]

Every node of shape in glyph space.

ink_box

ink_box(contours: Iterable[Sequence[tuple[float, float, bool]]]) -> tuple[float, float, float, float] | None

Exact (x, y, w, h) of cubic/quadratic contours given as (x, y, on) lists in glyph space.

invert

invert(m: Affine) -> Affine

is_identity

is_identity(m: Affine) -> bool

is_translation

is_translation(m: Affine) -> bool

layer_ink

layer_ink(layer: Layer, extra: Affine = IDENTITY) -> tuple[float, float, float, float] | None

Ink box of the layer's own outlines after extra (components excluded).

rotation

rotation(degrees: float) -> Affine

simulate

simulate(layer: Layer, steps: Iterable[tuple]) -> Layer

The snapshot layer after steps (baked shapes get an identity transform).

subject

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

transform_changes

transform_changes(layer: Layer, matrix: Affine, anchors: bool, note: str, *, bake_only: bool = False) -> list[Change]

Rows for matrix applied to every shape (and optionally anchors) of layer.

FontLab's layer-transform rule, as in fontlabapp.contours.transform: an own, unshared outline whose transform only moves is baked (new node positions); every other shape (components, shared outlines, scaled or rotated own outlines) keeps its nodes and gets the composed shape transform, so the whole glyph moves together. With bake_only (Smart Slant) components are skipped; its caller refuses them first.

translate

translate(dx: float, dy: float) -> Affine

verify

verify(label: str, expected: Layer, actual: Layer, steps: Sequence[tuple]) -> list[str]

Read-back problems: nodes and anchors beyond 0.5 unit, transforms beyond 1e-6, wrong counts.