Skip to content

fontlab.flContour · declarations 001

Back to fontlab.flContour

FigureType instance-attribute

FigureType: dict

add

add(QPointF: Any) -> Any

add(flNode | QPointF)

Appends a single node to the end of the contour. If you pass a QPointF, an on-curve node is created automatically at that position. This is the simplest way to build up a contour point by point.

Source: FontLab Proteus API documentation

append

append(flContour: Any) -> Any

append(list(flNode) | flContour)

Appends a batch of nodes from a list or from another contour onto the end of this contour. More efficient than calling add() in a loop when you have many nodes ready at once.

Source: FontLab Proteus API documentation

appendMapped

appendMapped(flContour: Any, arg1: QTransform) -> Any

appendMapped(list(flNode) | flContour, QTransform)

Like append, but applies a transformation matrix to each incoming node's coordinates before adding it. Ideal for adding a mirrored or rotated copy of a path segment.

Source: FontLab Proteus API documentation

applyTransform

applyTransform() -> Any

applyTransform()

Bakes the contour's accumulated transform matrix into its node coordinates, then resets the matrix to identity. Call this when you want the stored transform to become permanent.

Source: FontLab Proteus API documentation

assign

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

assign(flContour | fgContour | list(flNode))

Completely replaces this contour's content with the nodes from another contour, a fontgate contour, or a list. The previous nodes are discarded.

Source: FontLab Proteus API documentation

assignOwner

assignOwner() -> Any

assignOwner()

Re-attaches this contour to its owning flShape. Needed if you have moved the contour object between shapes manually.

Source: FontLab Proteus API documentation

at

at(index: int) -> flNode

flNode at(int index)

Returns the node at the given index. The index wraps around (so -1 gives you the last node), which is convenient for circular contour traversal.

Source: FontLab Proteus API documentation

autoG2

autoG2(tolerance: float) -> Any

autoG2(float tolerance)

Automatically applies G2 continuity to any smooth nodes whose handles are within tolerance of the G2-optimal position. A higher tolerance applies G2 more aggressively.

Source: FontLab Proteus API documentation

beautify

beautify(precision: Any = ...) -> bool

bool beautify([int precision = 1])

Applies FontLab's automatic curve-quality improvement algorithm to the entire contour. This adjusts handle lengths and directions to improve smoothness and balance. Returns True if any changes were made. Equivalent to running "Harmonize" in the glyph editor.

Source: FontLab Proteus API documentation

bindDependencies

bindDependencies() -> Any

bindDependencies()

Rebuilds internal links between this contour and any dependent objects (such as component references). Normally called automatically, but may be needed after manual low-level edits.

Source: FontLab Proteus API documentation

boundingBox

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

QRectF boundingBox([QTransform])

Returns the axis-aligned bounding box of the contour, optionally after applying a transform. This is the tight rectangle that just encloses all the nodes (including off-curve handles).

Source: FontLab Proteus API documentation

bounds instance-attribute

bounds: Any

The bounds of the contour as tuple (xMin, yMin, xMax, yMax) or None

The bounding box of the contour as a plain 4-tuple of floats. Returns None for empty contours. Faster to use than boundingBox() when you just need the raw numbers and don't need a QRectF object.

Source: FontLab Proteus API documentation

breakContour

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

(flContour, flNode, flNode)/Nothing breakContour(flNode) | flContour/Nothing breakContour(int node_ix)

Splits the contour at the given node or index, producing two open contour pieces. Returns the two resulting contours (and the boundary node copies) in a tuple. Returns None if the break cannot be performed.

Source: FontLab Proteus API documentation

breakContourExpanded

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

flContour/Nothing breakContourExpanded(int node_ix | flNode [, float extrapolate_d]

Like breakContour but can also extend the resulting open contour endpoints by extrapolate_d em units beyond the break point.

Source: FontLab Proteus API documentation

calculate

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

QPointF calculate(float t[, QTransform tx])

Returns the exact point on the contour at parameter t. This uses the full Bézier math, so it works for any t value between nodes, not just at node positions. Pass an optional transform to evaluate in a transformed coordinate space.

Source: FontLab Proteus API documentation

checkSmooth

checkSmooth() -> Any

checkSmooth()

Scans the contour's nodes and corrects any smooth flags that are inconsistent with the actual handle geometry. Run this after importing outlines or performing bulk edits.

Source: FontLab Proteus API documentation

clearNodes

clearNodes() -> Any

clearNodes()

Removes every node from the contour, leaving it empty. The contour object itself remains valid and can be re-populated.

Source: FontLab Proteus API documentation

clockwise instance-attribute

clockwise: Any

Bool indicating if the contour’s winding direction is clockwise

True if the contour's winding direction is clockwise. In PostScript fonts, outer shapes should be counter-clockwise (clockwise = False) and counter-shapes (holes) should be clockwise (clockwise = True). Always verify this after building contours programmatically.

Source: FontLab Proteus API documentation

cloneMapped

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

flContour cloneMapped(QTransform[, float ex_t0, float ex_t1])

Creates a transformed copy of the contour (or a portion of it). Use this to produce a reflected or rotated version of a path for use as a component or a symmetrical counter-shape.

Source: FontLab Proteus API documentation

cloneMappedByT

cloneMappedByT(tx: QTransform, t0: float, t1: float) -> flContour

flContour cloneMappedByT(QTransform tx, float t0, float t1)

Like cloneMapped but uses standard t coordinates to specify the range.

Source: FontLab Proteus API documentation

cloneSelected

cloneSelected(ignore_alone: Any = ...) -> Any

list(flContour)/Nothing cloneSelected([QTransform, [bool ignore_alone=true]])

Clones only the selected portions of the contour, returning them as separate contour objects. Returns None if nothing is selected.

Source: FontLab Proteus API documentation

closed instance-attribute

closed: Any

closed attribute

True if the contour is closed (the last node connects back to the first, enclosing an area). False for an open path with two free endpoints. Set this to True after building a contour to seal it.

Source: FontLab Proteus API documentation

closedT1 instance-attribute

closedT1: Any

closedT1 attr

The closed-parameter end value used internally for range validation in closed contours.

Source: FontLab Proteus API documentation

compare

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

(bool result, QPointF offset) compare(flContour, float error)

Deeply compares two contours for shape equality within error tolerance, and returns the offset vector between them if they match. Useful for font comparison or duplicate detection.

Source: FontLab Proteus API documentation

contains

contains(QPointF: Any) -> bool

bool contains(flContour knife | QPointF)

Returns True if the given point or the entirety of the given contour lies inside this contour's filled area. Useful for determining whether a counter-shape is properly enclosed by its outer shape.

Source: FontLab Proteus API documentation

convertExToT

convertExToT(arg0: float) -> float

float convertExToT(float)

Converts an extended-parameter ex_t back to a standard t value.

Source: FontLab Proteus API documentation

convertTTtoCurve

convertTTtoCurve() -> Any

convertTTtoCurve()

Converts a TrueType-flavored contour (using quadratic off-curve nodes) to PostScript-style cubic Bézier curves. Run this when you've imported a TrueType outline and want to work with it using the cubic editing tools.

Source: FontLab Proteus API documentation

convertToFgContour

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

fgContour convertToFgContour([QTransform tx])

Exports this contour to a low-level fgContour object (the underlying fontgate representation). Useful when interfacing with low-level font processing code.

Source: FontLab Proteus API documentation

convertTtoEx

convertTtoEx(arg0: float) -> float

float convertTtoEx(float)

Converts a standard t value to the extended-parameter format ex_t.

Source: FontLab Proteus API documentation

curvature

curvature(arg0: float) -> float

float curvature(float)

Returns the curvature (in 1/units) at t. High values mean tight curves; low values mean gentle bends. Use this to find the points of maximum curvature on a letter's bowl.

Source: FontLab Proteus API documentation

derivative

derivative(arg0: float) -> QPointF

QPointF derivative(float)

Returns the first derivative (tangent vector) at t. The direction of this vector is the direction the path is traveling at that point, and its length relates to the speed of parameterization. Useful for aligning decorative elements along a path.

Source: FontLab Proteus API documentation

distanceBetween

distanceBetween(t0: float, step: Any = ...) -> float

float distanceBetween(float t0, float t1[, float step =0.1])

Estimates the arc distance between two parameter values by numerical integration. Lower step values give more accurate results.

Source: FontLab Proteus API documentation

draw

draw(pen: Any) -> Any

draw(pen) - Draw the contour’s outline data to the given type-pen

Draws this contour's outline to a type-pen object. The pen receives moveTo, curveTo, lineTo, and endPath/closePath calls in the standard sequence. Use this to export contour data to fontTools or other libraries.

Source: FontLab Proteus API documentation

drawPoints

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

drawPoints(point-pen) - Draw the contour’s outline data to the given type-point-pen

Draws outline data to a point-pen, which receives individual point records including off-curve handles. This is the more low-level protocol used by UFO-based tools.

Source: FontLab Proteus API documentation

extrapolateFirst

extrapolateFirst(arg0: float) -> Any

extrapolateFirst(float)

Extends the open contour from its first node by the given distance along the tangent direction. Useful for adding visual overlap in stroke-based designs.

Source: FontLab Proteus API documentation

extrapolateLast

extrapolateLast(arg0: float) -> Any

extrapolateLast(float)

Extends the open contour from its last node by the given distance along the tangent direction.

Source: FontLab Proteus API documentation

fastAppend

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

fastAppend( list(flNode) )

A performance-optimized version of append that batches the work and skips intermediate update notifications. Use this when adding large numbers of nodes at once and you'll call fl.Update() yourself afterward.

Source: FontLab Proteus API documentation

fastClone

fastClone(ex_t0: float, ex_t1: float) -> flContour

flContour fastClone(float ex_t0, float ex_t1)

Creates a new contour that covers the portion of this contour between ex_t0 and ex_t1 (in extended-parameter coordinates). The original contour is not modified.

Source: FontLab Proteus API documentation

fastCloneByT

fastCloneByT(t0: float, t1: float) -> flContour

flContour fastCloneByT(float t0, float t1)

Same as fastClone but uses standard t parameter coordinates. This is the more intuitive version for most use cases.

Source: FontLab Proteus API documentation