Skip to content

fontlab.flContour · declarations 003

Back to fontlab.flContour

isLast

isLast(arg0: flNode) -> bool

bool isLast(flNode)

Returns True if the given node is the last node in this contour.

Source: FontLab Proteus API documentation

isSelected

isSelected(arg0: float) -> bool

bool isSelected(float)

Returns True if the contour is considered "selected" — meaning enough of its nodes are selected within the given tolerance.

Source: FontLab Proteus API documentation

isTT instance-attribute

isTT: Any

is truetype

True if the contour contains TrueType-style quadratic nodes. False for PostScript cubic Bézier contours. This determines which editing model and conversion tools apply.

Source: FontLab Proteus API documentation

last instance-attribute

last: Any

last node

The last node in the contour's node list.

Source: FontLab Proteus API documentation

layer instance-attribute

layer: Any

The contour’s parent layer

The layer that contains this contour. Use this to access other contours on the same layer or to get layer-level properties like the master name.

Source: FontLab Proteus API documentation

mapParamT

mapParamT(arg0: float, arg1: float, arg2: float) -> float

float mapParamT(float, float, float)

Remaps a t value from one parametric range to another. Useful when transferring parameter positions between differently-structured contours.

Source: FontLab Proteus API documentation

move

move(arg0: QPointF) -> Any

move(QPointF)

Translates the entire contour — every node — by the given offset vector. This is the simplest way to reposition a whole path.

Source: FontLab Proteus API documentation

nodes

nodes() -> Any

list(flNode) nodes()

Returns a fresh list containing every node in the contour — both on-curve and off-curve. This is the standard way to iterate over a contour's points. Because it's a snapshot, changes made to the original contour won't affect the list mid-iteration.

Source: FontLab Proteus API documentation

nodesCount instance-attribute

nodesCount: Any

nodes count

The total number of nodes in the contour, including both on-curve and off-curve nodes. A simple closed oval in PostScript format typically has 4 on-curve nodes and 8 off-curve handles = 12 nodes total.

Source: FontLab Proteus API documentation

normalAt

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

float normalAt(float t[, QTransform])

Returns the angle of the normal (perpendicular to the tangent) at t. Useful for offsetting a path or placing elements perpendicular to a curve.

Source: FontLab Proteus API documentation

normalPoint

normalPoint(t: float, length: float) -> QPointF

QPointF normalPoint(float t, float length)

Returns a point that is length units away from the contour at t, measured along the normal direction. Useful for generating offset paths.

Source: FontLab Proteus API documentation

normalizeExT

normalizeExT(arg0: float) -> float

float normalizeExT(float)

Normalizes an extended-parameter value to lie within the valid range of the contour.

Source: FontLab Proteus API documentation

paramT0 instance-attribute

paramT0: Any

paramT0 attr

The parametric start value of the contour's valid range. Normally 0.0.

Source: FontLab Proteus API documentation

paramT1 instance-attribute

paramT1: Any

paramT1 attr

The parametric end value. For a closed contour this equals nodesCount; for an open contour it may differ.

Source: FontLab Proteus API documentation

path

path() -> QPainterPath

QPainterPath path()

Returns the full contour as a QPainterPath object, which can be used with Qt's drawing primitives or for hit-testing.

Source: FontLab Proteus API documentation

pointInside

pointInside(pt: QPointF) -> Any

pointInside(QPointF pt) - Bool indicating if the point pt in the black area of the contour

Returns True if the point pt lies inside the area enclosed by this contour (using the even-odd or non-zero rule, depending on the font's fill rule). This is the go-to method for testing spatial relationships between shapes.

Source: FontLab Proteus API documentation

pointf

pointf(index: int) -> QPointF

QPointF pointf(int index)

A quick way to get the position of the on-curve node at index without retrieving the full node object.

Source: FontLab Proteus API documentation

prevLast instance-attribute

prevLast: Any

last but one node

The second-to-last node (the node just before last).

Source: FontLab Proteus API documentation

removeAt

removeAt(index: int) -> Any

removeAt(int index)

Removes the node at the given index. All subsequent nodes shift down by one.

Source: FontLab Proteus API documentation

removeLast

removeLast() -> Any

removeLast()

Removes the last node in the contour. Useful when building a contour incrementally and you need to undo the last add().

Source: FontLab Proteus API documentation

removeNodesBetween

removeNodesBetween(prev: flNode, next: flNode) -> Any

removeNodesBetween(flNode prev, flNode next)

Removes all nodes that lie between prev and next in the node sequence. The boundary nodes themselves are kept. Useful for simplifying a segment of a path.

Source: FontLab Proteus API documentation

removeOne

removeOne(arg0: flNode) -> Any

removeOne(flNode)

Removes a specific node object from the contour. Useful when you have a direct reference to the node (from a previous call to nodes() or find()) and don't want to look up its index.

Source: FontLab Proteus API documentation

replace

replace(old_node: flNode, new_node: flNode) -> Any

replace(flNode old_node, flNode new_node)

Swaps one specific node for another, preserving its position in the contour. Useful when you've constructed a replacement node and want to substitute it without disturbing neighbors.

Source: FontLab Proteus API documentation

reverse

reverse() -> Any

reverse() - Reverse the direction of the contour

Reverses the winding direction of the contour in place — counter-clockwise becomes clockwise and vice versa. This is the direct way to fix an incorrectly wound path. The shape is unchanged; only the traversal direction flips.

Source: FontLab Proteus API documentation

reversed instance-attribute

reversed: Any

reversed

True if the contour has been reversed relative to its original orientation. Useful for detecting whether reverse() has been called.

Source: FontLab Proteus API documentation

secondDerivative

secondDerivative(arg0: float) -> QPointF

QPointF secondDerivative(float)

Returns the second derivative at t, which is used for curvature calculations. Less commonly needed in type design scripts but essential for curvature comb analysis tools.

Source: FontLab Proteus API documentation

segment

segment(t: float) -> Any

CurveEx/Nothing segment(float t)

Returns the single segment that contains parameter t. Useful for working on a specific part of the curve without iterating over all segments.

Source: FontLab Proteus API documentation

segments

segments() -> Any

list(CurveEx) segments()

Returns all the Bézier segments of the contour as a list of CurveEx objects. Each segment covers one on-curve-to-on-curve span with its intermediate off-curve handles. Useful for per-segment analysis.

Source: FontLab Proteus API documentation

selectedPath

selectedPath() -> QPainterPath

QPainterPath selectedPath()

Returns only the selected portions of the contour as a QPainterPath.

Source: FontLab Proteus API documentation

selection instance-attribute

selection: Any

selection list (list)

A list of boolean values, one per node, indicating which nodes are selected. Reading this gives you the full selection state in one shot. Writing a new list sets all node selections at once — must be the same length as nodesCount.

Source: FontLab Proteus API documentation

selectionChanged

selectionChanged() -> Any

selectionChanged()

Notifies FontLab's display system that the selection state has changed and the view should be updated. Call this after programmatically changing node.selected flags to ensure the editor redraws correctly.

Source: FontLab Proteus API documentation

setNext

setNext(int: Any, arg1: QPointF) -> flNode

flNode setNext(int, QPointF)

Sets the position of the off-curve handle after the on-curve node at index. This is the "outgoing" Bézier handle that controls how the curve departs from that node.

Source: FontLab Proteus API documentation

setPoint

setPoint(index: int, p: QPointF) -> flNode

flNode setPoint(int index, QPointF p)

Moves the node at index to position p and returns the updated node. A convenient alternative to reading the node, setting x/y, and writing it back.

Source: FontLab Proteus API documentation

setPrev

setPrev(int: Any, arg1: QPointF) -> flNode

flNode setPrev(int, QPointF)

Sets the position of the off-curve handle before the on-curve node at index. This is the "incoming" Bézier handle that controls how the curve arrives at that node.

Source: FontLab Proteus API documentation

setSelectedNodes

setSelectedNodes(bool: Any) -> Any

setSelectedNodes(bool)

Selects all nodes if True, or deselects all nodes if False. A quick way to select or clear an entire contour.

Source: FontLab Proteus API documentation

setStartPoint

setStartPoint(i: int) -> bool

bool setStartPoint(int i)

Rotates the contour's node list so that the node at index i becomes the first node. This changes which node is considered the "start" of the contour without changing the shape. Returns True on success.

Source: FontLab Proteus API documentation

simplify

simplify(precision: float, lossy: bool, extremes: bool) -> Any

simplify(float precision, bool lossy, bool extremes)

Removes unnecessary nodes while keeping the contour's shape within precision em units of the original. lossy=True allows slightly larger deviations for a more aggressive simplification. extremes=True preserves nodes at curve extrema even if they could otherwise be removed.

Source: FontLab Proteus API documentation

takeNodes

takeNodes() -> Any

list(flNode) takeNodes()

Removes all nodes from the contour and returns them as a list. The contour is left empty. Useful for transferring ownership of nodes between contours.

Source: FontLab Proteus API documentation

tangent

tangent(t: float) -> float

float tangent(float t)

Returns the tangent angle at t in degrees, measured from the positive X axis. Useful for checking whether a part of the curve is horizontal, vertical, or at a specific angle.

Source: FontLab Proteus API documentation

toBeziers

toBeziers(tolerance: float) -> Any

toBeziers(float tolerance)

Approximates any spline segments in the contour as standard cubic Bézier curves, within the given tolerance in em units. Useful before exporting or processing with tools that expect pure cubic Béziers.

Source: FontLab Proteus API documentation