Skip to content

fontlab.flNode · declarations 001

Back to fontlab.flNode

angle instance-attribute

angle: Any

angle

The angle of the node in degrees, representing the direction of the outgoing tangent. Useful for checking the orientation of handles or detecting near-horizontal/vertical alignments.

Source: FontLab Proteus API documentation

angleTo

angleTo(p: QPointF) -> float

double angleTo(QPointF p)

Returns the angle in degrees between this node and a given point, measured from the positive X axis. Helpful when aligning nodes along a specific angle.

Source: FontLab Proteus API documentation

applyTransform

applyTransform(arg0: QTransform) -> Any

applyTransform(QTransform)

A lower-level transform application that works directly on the node's stored coordinates. Equivalent to transformBy in most cases.

Source: FontLab Proteus API documentation

canBeHobby

canBeHobby() -> bool

bool canBeHobby()

Returns True if this node and its neighbors are in a configuration that supports Hobby-spline optimization.

Source: FontLab Proteus API documentation

canBeSmooth

canBeSmooth() -> bool

bool canBeSmooth()

Returns True if the handles around this node are already collinear (pointing in opposite directions through the node), meaning it could be set to smooth without changing the curve's shape.

Source: FontLab Proteus API documentation

canCollapse

canCollapse() -> bool

bool canCollapse()

Returns True if this node's handles are short enough (effectively zero-length) that they can be safely collapsed without changing the visual appearance of the outline.

Source: FontLab Proteus API documentation

canImprove

canImprove() -> bool

bool canImprove()

Returns True if FontLab's curve-quality heuristics think this node's position or handle angles could be improved for better curve tension.

Source: FontLab Proteus API documentation

checkVectors

checkVectors() -> bool

bool checkVectors()

Examines the handles around this node to see if they are well-formed — for example, that they don't have zero length or degenerate positions. Returns True if everything is in order.

Source: FontLab Proteus API documentation

cloneMapped

cloneMapped(arg0: QTransform) -> flNode

flNode cloneMapped(QTransform)

Creates a copy of this node with its coordinates transformed by the given matrix. The original is not modified. Useful for building reflected or rotated copies of individual points.

Source: FontLab Proteus API documentation

collapseHandles

collapseHandles() -> bool

bool collapseHandles()

If the off-curve handles of this node are sitting on top of their on-curve anchor (zero length), this method removes them and converts the segment to a line. Returns True if handles were collapsed.

Source: FontLab Proteus API documentation

contour instance-attribute

contour: Any

The parent Contour or None if not present

A reference to the flContour that this node belongs to. Use this to access sibling nodes or the contour's properties from within a node loop.

Source: FontLab Proteus API documentation

convertToCurve

convertToCurve(smooth: Any = ...) -> bool

bool convertToCurve([bool smooth = false])

Similar to convertToCurves but targets just the single outgoing segment. Pass smooth=True to also set the smooth flag on the resulting node. Returns True on success.

Source: FontLab Proteus API documentation

convertToCurves

convertToCurves() -> bool

bool convertToCurves()

Converts this on-curve node and its neighboring segments to use cubic Bézier control points, turning what may have been straight lines into curve segments ready for handle manipulation. Returns True if the conversion was performed.

Source: FontLab Proteus API documentation

convertToLine

convertToLine() -> bool

bool convertToLine()

Removes the off-curve handles from the segment leading into this node, making it a straight line segment. Useful for simplifying curves to line segments in bulk cleanup scripts. Returns True on success.

Source: FontLab Proteus API documentation

copyFrom

copyFrom(withSelected: Any = ...) -> Any

copyFrom(Node[, withSelected=False])

Copies the position, type, smooth flag, and other properties from another node into this one. Pass withSelected=True to also copy the selection state.

Source: FontLab Proteus API documentation

distanceTo

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

double distanceTo(Node/QPointF)

Calculates the straight-line distance between this node and another node or a given point in em units. Useful for checking whether nodes are coincident or within a snapping tolerance.

Source: FontLab Proteus API documentation

g2 instance-attribute

g2: Any

g2

True if G2 curvature continuity is active on this node. Setting this enables or disables the G2 constraint.

Source: FontLab Proteus API documentation

getLines

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

(QLineF, QLineF)/None getLines()

Returns the two tangent lines passing through this node — one toward the previous segment and one toward the next. This is useful for smooth-node validation or for computing intersection points. Returns a tuple (QLineF, QLineF), or None if the node has no handles.

Source: FontLab Proteus API documentation

getOn

getOn() -> Any

Node/None getOn()

If this node is an off-curve handle, returns its associated on-curve anchor node. If called on an on-curve node, returns the node itself. Returns None if the relationship cannot be determined.

Source: FontLab Proteus API documentation

hobby instance-attribute

hobby: Any

hobby

True if this node is using Hobby-spline tension optimization. Setting this to True enables automatic handle-length calculation based on the Hobby algorithm for aesthetically pleasing curves.

Source: FontLab Proteus API documentation

improve

improve() -> bool

bool improve()

Attempts to automatically improve the curve quality around this node by adjusting handle lengths and directions. Returns True if any change was made.

Source: FontLab Proteus API documentation

index instance-attribute

index: Any

The index of the node in parent's contour (if present, otherwise -1)

The node's zero-based position in the contour's node list. Both on-curve and off-curve nodes are counted. Setting this would reorder the node within the contour.

Source: FontLab Proteus API documentation

interpolated instance-attribute

interpolated: Any

interpolated

A tuple combining (interpolatedX, interpolatedY) for convenient reading and writing of both interpolation flags at once.

Source: FontLab Proteus API documentation

interpolatedX instance-attribute

interpolatedX: Any

interpolatedX

When True, the node's X coordinate is treated as interpolated between masters rather than being independently controlled. Used in variable font workflows.

Source: FontLab Proteus API documentation

interpolatedY instance-attribute

interpolatedY: Any

interpolatedY

Same as interpolatedX but for the Y axis.

Source: FontLab Proteus API documentation

isCorner

isCorner(a: Any = ...) -> bool

bool isCorner([double a = 10.])

Returns True if this node is a corner — meaning the angle between its incoming and outgoing tangents exceeds angle degrees. The default threshold of 10° filters out nearly-smooth nodes that only deviate slightly.

Source: FontLab Proteus API documentation

isCurve

isCurve() -> bool

bool isCurve()

Returns True if this node is an on-curve node that is part of a curve segment (as opposed to a line segment).

Source: FontLab Proteus API documentation

isEqualTo

isEqualTo(tolerance: Any = ...) -> bool

bool isEqualTo(Node[, tolerance=0.1[, offset=QPointF(0, 0)]])

Returns True if this node has the same coordinates as another node (within tolerance). The optional offset shifts one node before comparison — useful for checking compatibility between masters that have different side-bearings.

Source: FontLab Proteus API documentation

isExtreme

isExtreme(open: Any = ...) -> bool

bool isExtreme(bool x[, bool open = true[, double limit = 0]])

Returns True if this node sits at a local extremum of the outline. Set x=True to check horizontal extremes (leftmost/rightmost), x=False for vertical. The open flag controls whether open contour endpoints count, and limit sets a flatness tolerance.

Source: FontLab Proteus API documentation

isFirst

isFirst() -> bool

bool isFirst()

Returns True if this node is the designated start node of its contour.

Source: FontLab Proteus API documentation

isG2

isG2(tolerance: float) -> bool

bool isG2(double tolerance)

Returns True if this node currently satisfies G2 continuity within the given angular tolerance.

Source: FontLab Proteus API documentation

isInternal

isInternal(clockwise: bool) -> bool

bool isInternal(bool clockwise)

Returns True if this node appears to be on the inside (counter) of an outline, given the specified winding direction. Helpful for identifying nodes that belong to counter-shapes like the inside of an "O".

Source: FontLab Proteus API documentation

isInterpolated

isInterpolated(x: bool) -> bool

bool isInterpolated(bool x)

Returns True if the specified coordinate of this node is marked as interpolated between masters. Pass True to check X, False to check Y. Equivalent to reading interpolatedX or interpolatedY as a method call.

Source: FontLab Proteus API documentation

isLast

isLast() -> bool

bool isLast()

Returns True if this is the last node in the contour's node list. In a closed contour, the last node connects back to the first.

Source: FontLab Proteus API documentation

isNull instance-attribute

isNull: Any

bool

True if this node object is a null/invalid reference — for example, if you called nextNode() and there was no next node. Always check this before using a node returned from navigation methods.

Source: FontLab Proteus API documentation

isOff

isOff() -> bool

bool isOff()

Returns True if this is an off-curve handle (Bézier control point).

Source: FontLab Proteus API documentation

isOn

isOn() -> bool

bool isOn()

Returns True if this is an on-curve node — one that the path actually passes through.

Source: FontLab Proteus API documentation

isSelectedAlone instance-attribute

isSelectedAlone: Any

bool

True if this node is selected and it is the only selected node in the contour. Useful when you want to restrict an operation to single-node selections.

Source: FontLab Proteus API documentation

isSmartAngle

isSmartAngle() -> bool

bool isSmartAngle()

Returns True if this node has the Smart Angle feature enabled, meaning it can transition smoothly between a corner and a smooth point across the design space.

Source: FontLab Proteus API documentation

isTerminal instance-attribute

isTerminal: Any

bool

True if this node is at an endpoint of an open contour (either the very first or very last node with no connecting segment).

Source: FontLab Proteus API documentation