Skip to content

fontlab_pens.transform.Transform · declarations 001

Back to fontlab_pens.transform.Transform

__bool__

__bool__() -> bool

True unless this is the identity transformation.

__repr__

__repr__() -> str

dx class-attribute instance-attribute

dx: float

dy class-attribute instance-attribute

dy: float

inverse

inverse() -> Transform

Return the inverse transformation (ZeroDivisionError if singular).

reverseTransform

reverseTransform(other: Sequence[float]) -> Transform

Return this transformation applied first, then other.

rotate

rotate(angle: float) -> Transform

Return this transformation rotated by angle radians.

scale

scale(x: float = 1, y: float | None = None) -> Transform

Return this transformation scaled by x, y (y defaults to x).

skew

skew(x: float = 0, y: float = 0) -> Transform

Return this transformation skewed by x and y radians.

toPS

toPS() -> str

Return the PostScript matrix representation, e.g. [2 0 0 3 8 15].

transform

transform(other: Sequence[float]) -> Transform

Return other applied first, then this transformation.

transformPoint

transformPoint(p: Point) -> Point

Return p transformed.

transformPoints

transformPoints(points: Iterable[Point]) -> list[Point]

Return a list of transformed points.

transformVector

transformVector(v: Point) -> Point

Transform an (dx, dy) vector, ignoring the offset.

transformVectors

transformVectors(vectors: Iterable[Point]) -> list[Point]

Transform (dx, dy) vectors, ignoring the offset.

translate

translate(x: float = 0, y: float = 0) -> Transform

Return this transformation offset by x, y.

xx class-attribute instance-attribute

xx: float

xy class-attribute instance-attribute

xy: float

yx class-attribute instance-attribute

yx: float

yy class-attribute instance-attribute

yy: float