fontlab.flContour · declarations 002
find
find(*args: Any, **kwargs: Any) -> Any
flNode find(QPointF, float, flNode::NodeType)
Searches for a node whose position is within tolerance units of p and matches the given type. Useful for snapping or hit-testing.
Source: FontLab Proteus API documentation
findNearest
findNearest(*args: Any, **kwargs: Any) -> Any
(float out_nearest_t, float dist)/Nothing findNearest(QPointF shape_p[, int orientation=0])
Finds the parametric position on the contour that is geometrically closest to the given QPointF. Returns the t value and the distance, or None if the contour is empty.
Source: FontLab Proteus API documentation
findNearestNode
findNearestNode(*args: Any, **kwargs: Any) -> Any
(flNode, float new_maxd)/Nothing findNearestNode(QPointF p, flNode::NodeType node_type, float maxd)
Finds the node of the given type that is closest to the given point and within maxd units. Returns both the node and the actual distance found (as the updated maxd). Returns None if no node is within range.
Source: FontLab Proteus API documentation
findNearestOn
findNearestOn(p: QPointF, base_t: float) -> Any
float out_nearest_t/Nothing findNearestOn(QPointF p, float base_t)
Finds the nearest on-curve point to p, starting from the hint position base_t. Useful for iterative closest-point searches.
Source: FontLab Proteus API documentation
findNode
findNode(name: Any) -> Any
flNode/Nothing findNode(uint id | string name)
Looks up a specific node by its internal numeric ID or by a named tag. Handy when you've stored a reference to a node's identity and need to retrieve it later.
Source: FontLab Proteus API documentation
first
instance-attribute
first: Any
first node
The first node in the contour's node list. Equivalent to at(0) but faster.
Source: FontLab Proteus API documentation
font
instance-attribute
font: Any
The contour’s parent font
The font that owns the glyph containing this contour. Useful for accessing global font metrics (like UPM or ascender height) from within a contour-level script.
Source: FontLab Proteus API documentation
getBoundedT
getBoundedT(param_t: float, radius: float) -> float
float getBoundedT(float param_t, float radius)
Returns t adjusted to stay at least radius arc-units away from any segment boundary. Useful when placing nodes to avoid degenerate near-zero segments.
Source: FontLab Proteus API documentation
getChangesRect
getChangesRect() -> QRectF
QRectF getChangesRect()
Returns the rectangle that covers the area most recently modified in this contour. Used for optimized incremental redraws.
Source: FontLab Proteus API documentation
getFirstPoint
getFirstPoint(*args: Any, **kwargs: Any) -> Any
QPointF/Nothing getFirstPoint([int =0])
Returns the position of the first on-curve node in the contour. Returns None for an empty contour. The integer argument selects which type of "first" to use (default 0 = standard first node).
Source: FontLab Proteus API documentation
getLastPoint
getLastPoint(*args: Any, **kwargs: Any) -> Any
QPointF/Nothing getLastPoint([int =0])
Returns the position of the last on-curve node. For a closed contour, this is the node just before wrapping back to the first.
Source: FontLab Proteus API documentation
getLength
getLength(int: Any = 10) -> float
float getLength([float t0, float t1,] int =10)
Estimates the arc length of the entire contour, or of the portion between t0 and t1. More steps gives better accuracy for highly curved segments.
Source: FontLab Proteus API documentation
getLengthSquareBRect
getLengthSquareBRect(*args: Any, **kwargs: Any) -> Any
(float square, float length, QRectF brect) getLengthSquareBRect(float t0, float t1[, int step=10])
Returns three things at once: the enclosed area, the arc length, and the bounding rectangle for the contour segment between t0 and t1. Useful for computing metrics in a single efficient call.
Source: FontLab Proteus API documentation
getNext
getNext(*args: Any, **kwargs: Any) -> Any
flNode/Nothing getNext(index[, flNode::NodeType=flNode::On])
Starting just after index, walks forward through the contour until it finds a node of the requested type. Defaults to finding the next on-curve node. Returns None if no match is found before wrapping all the way around.
Source: FontLab Proteus API documentation
getNextT
getNextT(*args: Any, **kwargs: Any) -> Any
(bool, float) getNextT(float base_t, float offset)
Advances base_t forward by arc-length offset along the contour. Returns (True, new_t) if successful, or (False, ...) if the advance went past the contour's end.
Source: FontLab Proteus API documentation
getNodeAt
getNodeAt(*args: Any, **kwargs: Any) -> Any
flNode/Nothing getNodeAt(int idx[, flNode::NodeType = flNode::AnyNodeMask])
Returns the node at idx, but only if it matches the given NodeType filter. Returns None if the node exists but is the wrong type.
Source: FontLab Proteus API documentation
getPoint
getPoint(*args: Any, **kwargs: Any) -> Any
QPointF/Nothing getPoint(int idx[, flNode::NodeType = flNode::On])
A convenience shortcut that returns just the position of the node at idx (as a QPointF) rather than the full node object. Returns None if there is no matching node.
Source: FontLab Proteus API documentation
getPrev
getPrev(*args: Any, **kwargs: Any) -> Any
flNode/Nothing getPrev(index[, flNode::NodeType=flNode::On])
Like getNext but walks backward. Use this to find the on-curve node that precedes a given off-curve handle.
Source: FontLab Proteus API documentation
getPrevT
getPrevT(*args: Any, **kwargs: Any) -> Any
(bool, float) getPrevT(float base_t, float offset)
Same as getNextT but moves backward along the contour.
Source: FontLab Proteus API documentation
getSegment
getSegment(i0: int, i1: int, left: bool) -> Any
list(flNode) getSegment(int i0, int i1, bool left)
Extracts the subsequence of nodes between indices i0 and i1. The left flag controls whether to take the shorter arc or the longer arc in a closed contour. Useful for working on a specific portion of a path.
Source: FontLab Proteus API documentation
getSelectedBoundingBox
getSelectedBoundingBox() -> QRectF
QRectF getSelectedBoundingBox()
Returns the bounding box that encloses all currently selected nodes. Useful for centering or aligning selected point groups.
Source: FontLab Proteus API documentation
getSelectedNodes
getSelectedNodes() -> Any
list(flNode)/Nothing getSelectedNodes()
Returns only the nodes that are currently selected. Returns None (not an empty list) if no nodes are selected. Useful for operating on the user's current selection.
Source: FontLab Proteus API documentation
getSquare
getSquare() -> float
double getSquare()
Returns the signed area enclosed by the contour using the shoelace formula. Positive values indicate counter-clockwise winding, negative indicate clockwise. You can use the sign to determine winding direction without relying on the clockwise property.
Source: FontLab Proteus API documentation
getT
getT(arg0: flNode) -> float
float getT(flNode)
Returns the parameter t corresponding to a specific node. Useful when you have a node reference and need its parametric position for use in geometry calculations.
Source: FontLab Proteus API documentation
getUpdateRect
getUpdateRect(ex_t: float) -> QRectF
QRectF getUpdateRect(float ex_t)
Returns the bounding rectangle around the area of the contour that would be affected by a change at extended-parameter position ex_t. Used internally to optimize display refresh.
Source: FontLab Proteus API documentation
glyph
instance-attribute
glyph: Any
The contour’s parent glyph
The glyph that contains this contour. Provides a back-reference so you can access glyph-level properties (like name or Unicode) from within a contour loop.
Source: FontLab Proteus API documentation
hasCorners
instance-attribute
hasCorners: Any
hasCorners
True if the contour contains any corner (non-smooth) on-curve nodes.
Source: FontLab Proteus API documentation
hasIntersPoints
hasIntersPoints(arg0: flContour) -> bool
bool hasIntersPoints(flContour)
Returns True if this contour and the given contour have any intersection points. Useful for detecting overlapping shapes before running a Remove Overlaps operation.
Source: FontLab Proteus API documentation
hasSelected
hasSelected(SelectionMode: Any) -> bool
bool hasSelected(SelectionMode)
Returns True if at least one node satisfying the given SelectionMode criteria is selected. More flexible than isAllNodesSelected when you need partial-selection awareness.
Source: FontLab Proteus API documentation
hasSmartAngle
instance-attribute
hasSmartAngle: Any
hasSmartAngle
True if any node in the contour has the Smart Angle feature active.
Source: FontLab Proteus API documentation
improve
improve() -> bool
bool improve()
A single pass of FontLab's handle-improvement algorithm, focusing on tension and balance. Less aggressive than beautify. Returns True if changes were made.
Source: FontLab Proteus API documentation
indentParamT
indentParamT(base_t: float, step: Any = ...) -> float
float indentParamT(float base_t, float indent[, float step =0.1])
Returns a t value that is indent arc-units away from base_t, useful for placing marks or nodes inset from a reference position.
Source: FontLab Proteus API documentation
inkBox
inkBox(*args: Any, **kwargs: Any) -> Any
QRectF inkBox([QTransform tx])
Returns the ink bounding box — the tightest rectangle around the filled area of the contour. For contours, this is equivalent to boundingBox.
Source: FontLab Proteus API documentation
insert
insert(*args: Any, **kwargs: Any) -> Any
insert(index, flNode | list(flNode) )
Inserts one node or a list of nodes at the given position, shifting existing nodes to make room. Use this when you need to splice new points into the middle of an existing path.
Source: FontLab Proteus API documentation
insertNodeTo
insertNodeTo(t: float) -> flNode
flNode insertNodeTo(float t)
Inserts a new node at the exact parametric position t, splitting the segment at that point. The new node is returned. This is the programmatic equivalent of clicking on a path to add a point in the editor.
Source: FontLab Proteus API documentation
insertSafeNodeTo
insertSafeNodeTo(t: float, dst: float) -> flNode
flNode insertSafeNodeTo(float t, float dst)
Like insertNodeTo, but only inserts the node if it is at least dst em units away from any existing node, preventing the creation of degenerate near-zero segments.
Source: FontLab Proteus API documentation
isAllNodesSelected
isAllNodesSelected() -> bool
bool isAllNodesSelected()
Returns True only if every single node in the contour is currently selected.
Source: FontLab Proteus API documentation
isCompatible
isCompatible(arg0: flContour, strong: bool) -> bool
bool isCompatible(flContour, bool strong)
Returns True if the given contour has the same number and type of nodes as this one — a requirement for variable font interpolation. strong=True requires an exact match; strong=False allows some flexibility.
Source: FontLab Proteus API documentation
isComplete
instance-attribute
isComplete: Any
isComplete
True if the contour is in a fully initialized and consistent state — all node links valid and indices up to date.
Source: FontLab Proteus API documentation
isFirst
isFirst(arg0: flNode) -> bool
bool isFirst(flNode)
Returns True if the given node is the start (first) node of this contour.
Source: FontLab Proteus API documentation