Skip to content

fontlab.CurveEx · declarations 001

Back to fontlab.CurveEx

applyTransform

applyTransform(tx: QTransform) -> None

void applyTransform(QTransform& tx)

Moves, scales, or rotates all four points of this segment using the transform matrix tx. Modifies the segment in place. Call updateBRect() afterwards to refresh the cached bounding box.

Source: FontLab Proteus API documentation

bcp0 instance-attribute

bcp0: Any

QPointF bcp0

The off-curve handle adjacent to p0 (the outgoing handle). Moving this changes how the curve leaves p0.

Source: FontLab Proteus API documentation

bcp1 instance-attribute

bcp1: Any

QPointF bcp1

The off-curve handle adjacent to p1 (the incoming handle). Moving this changes how the curve arrives at p1.

Source: FontLab Proteus API documentation

bcv0 instance-attribute

bcv0: Any

QPointF bcv0

The direction vector from p0 to bcp0. A read-only derived value. Useful for normalising the handle direction.

Source: FontLab Proteus API documentation

bcv1 instance-attribute

bcv1: Any

QPointF bcv1

The direction vector from p1 to bcp1. Read-only.

Source: FontLab Proteus API documentation

brect instance-attribute

brect: Any

QRectF

The cached axis-aligned bounding rectangle of this segment. Update with updateBRect() after changing points.

Source: FontLab Proteus API documentation

contourIx instance-attribute

contourIx: Any

int

Index of the parent contour within its shape.

Source: FontLab Proteus API documentation

countPoints instance-attribute

countPoints: Any

int

Number of on-curve points in this segment: 2 for a cubic Bézier, 1 for a straight line segment.

Source: FontLab Proteus API documentation

empty

empty() -> bool

bool empty()

Returns True if this segment is degenerate — all four points coincide, or the segment has not been initialised. A segment with countPoints == 1 (a line) is not considered empty.

Source: FontLab Proteus API documentation

extremum

extremum(prev: Any) -> bool

bool extremum(CurveEx prev)

Checks whether the shared node between this segment and prev is at a local extremum — the topmost, bottommost, leftmost, or rightmost point of the curve at that junction. Returns True if it is an extremum. Use this when auditing a glyph for missing extremum nodes.

Source: FontLab Proteus API documentation

fastLength

fastLength() -> float

double fastLength()

Computes a quick approximation of the arc length (the actual measured length along the curve). The approximation uses the chord length plus a fraction of the handle distances — it is fast and good enough for most layout purposes, but not numerically exact.

Source: FontLab Proteus API documentation

improve

improve(curvature: Any = ...) -> bool

bool improve([double curvature = 1.0])

Adjusts the off-curve control points to improve the visual quality of the curve, targeting the given curvature factor. A factor of 1.0 preserves the approximate arc length while making the curve more balanced. Returns True if the points were changed.

Source: FontLab Proteus API documentation

leftIdx instance-attribute

leftIdx: Any

int

Index of the left node (p0) within the parent contour's node list.

Source: FontLab Proteus API documentation

p0 instance-attribute

p0: Any

QPointF p0

The left (start) on-curve point of this segment. This is the node at the beginning of the segment.

Source: FontLab Proteus API documentation

p1 instance-attribute

p1: Any

QPointF p1

The right (end) on-curve point of this segment. The node at the end.

Source: FontLab Proteus API documentation

paramT instance-attribute

paramT: Any

int

The parametric position (0..1) of the most recently queried point on this segment. Set by hit-test operations; read to find where on the segment a query point landed.

Source: FontLab Proteus API documentation

rightIdx instance-attribute

rightIdx: Any

int

Index of the right node (p1) within the parent contour's node list.

Source: FontLab Proteus API documentation

smooth

smooth(prev: Any) -> bool

bool smooth(CurveEx prev)

Checks whether this segment and the previous segment prev join smoothly (G1 continuity — the tangent direction is the same on both sides of the shared node). Returns True if smooth. Use this to find which nodes in an outline are already smooth before applying a smoothing script.

Source: FontLab Proteus API documentation

smoothCurvature

smoothCurvature(c1: Any, complete: bool) -> Any

CurveEx smoothCurvature(CurveEx c1, bool complete)

Returns a new CurveEx with its handles adjusted for smooth curvature continuity (G2) between this segment and c1. If complete is True, both ends of the returned segment are adjusted; if False, only the join end is adjusted.

Source: FontLab Proteus API documentation

split

split(*args: Any, **kwargs: Any) -> Any

bool split(CurveEx, CurveEx)

Splits this segment at its stored paramT value into two new segments. The two result segments are written into the two CurveEx arguments passed in. Returns True on success.

Source: FontLab Proteus API documentation

updateBRect

updateBRect() -> None

void updateBRect()

Recomputes the segment's cached bounding rectangle from its current point positions. Always call this after manually changing p0, p1, bcp0, or bcp1.

Source: FontLab Proteus API documentation