Skip to content

fontlab.flShape · declarations 001

Back to fontlab.flShape

activateBuilder

activateBuilder() -> Any

activateBuilder()

Enters the shape-builder editing mode for this shape, as if you had double-clicked to enter the parametric element. After calling this the shape's shapeBuilder is live and the UI reflects the editing state.

Source: FontLab Proteus API documentation

active instance-attribute

active: Any

bool

Whether this is the currently active (selected for editing) shape in its layer. At most one shape per layer is active at any time. Setting this to True deactivates any previously active shape.

Source: FontLab Proteus API documentation

addContour

addContour(arg0: flContour, check_duplicate: Any = False, validate: Any = True) -> Any

addContour(flContour, check_duplicate=False, validate=True)

Appends a single contour to this shape. After adding, the contour is owned by the shape; you should not add the same contour object to another shape.

Source: FontLab Proteus API documentation

addContours

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

addContours(list(flContour))

Adds multiple contours in one call. More efficient than calling addContour in a loop when you have many contours ready at once.

Source: FontLab Proteus API documentation

addSmartCorner

addSmartCorner(node: flNode, radius: float = 20, smooth: bool = False) -> bool

bool addSmartCorner(flNode node, float radius=20, bool smooth=False) - add/update a live smart corner; negative radius creates an ink trap; manages the filter; reacquire source nodes afterwards

addSmartCorners

addSmartCorners(radius: float = 20, smooth: bool = False) -> int

int addSmartCorners(float radius=20, bool smooth=False) - add live smart corners at applicable nodes, skip existing corners, return count; manages/reuses the filter

allSelectedData instance-attribute

allSelectedData: Any

bool

True if every node and every sub-shape in this shape is selected. Setting this to True is equivalent to calling selectAllData().

Source: FontLab Proteus API documentation

appendAnchor

appendAnchor(node: flNode, guideline: flObject) -> Any

appendAnchor(flAnchor) | void appendAnchor(flNode node, flObject guideline)

Adds an anchor to this shape. In the second form, creates the anchor at the position of a node and associates it with a guideline object — this is how FontLab auto-creates anchors from node+guide pairs.

Source: FontLab Proteus API documentation

applyTransform

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

applyTransform([QTransform transform])

Bakes the current transform (or a given transform) into the actual node coordinates, then resets the shape's transform to identity. After this call, the nodes have moved but the shape has no transform offset.

Source: FontLab Proteus API documentation

assign

assign(arg0: fgShape) -> Any

assign(fgShape)

Replaces all of this shape's content with the data from a low-level fontgate shape object. This is primarily used when bridging the lower-level fontgate API into the higher-level flShape world.

Source: FontLab Proteus API documentation

assignStyle

assignStyle(arg0: flShape) -> Any

assignStyle(flShape)

Copies the visual style properties (pen, brush, opacity) from another shape onto this one. Useful for making a new shape match the appearance of an existing one.

Source: FontLab Proteus API documentation

bindDependencies

bindDependencies() -> Any

bindDependencies()

Rebuilds all internal dependency links between this shape and its parametric processors. Call this after manually assembling a shape from parts, especially when combining contours from different sources.

Source: FontLab Proteus API documentation

boundingBox instance-attribute

boundingBox: Any

QRectF

Fast bounds in element-local coordinates, padded symmetrically for stroke thickness, proportion, and miter settings. These are not tight stroke bounds; proportions 0 and 100 can produce identical boxes. Use inkBox() to measure the rendered stroke, including the element transform.

Source: FontLab Proteus API documentation

brush instance-attribute

brush: Any

QBrush

The fill brush used when rendering this shape in colour font mode. For a plain black font, this is not used. For colour layers (COLRv1, SVG), this controls the fill colour and pattern.

Source: FontLab Proteus API documentation

canUngroup

canUngroup() -> bool

bool canUngroup()

Returns True if the shape is a composite or grouped structure that can be split apart into its constituent sub-shapes. Useful before calling ejectTo() — always check this first.

Source: FontLab Proteus API documentation

clearContours

clearContours() -> Any

clearContours()

Deletes every contour from this shape, leaving it empty. The shape itself remains on the layer, just with no drawing content.

Source: FontLab Proteus API documentation

cloneTopLevel

cloneTopLevel() -> flShape

flShape cloneTopLevel()

Creates a copy of this shape's top-level composite structure (without deep-copying all sub-shapes). Useful when you need a structural template of a composite.

Source: FontLab Proteus API documentation

closedPath instance-attribute

closedPath: Any

QPainterPath

A Qt painter path containing only the closed contours. Useful for rendering or geometric queries using Qt's path operations.

Source: FontLab Proteus API documentation

contains

contains(arg0: QPointF) -> bool

bool contains(QPointF)

Tests whether a given point in glyph-space coordinates falls inside the filled area of this shape. Great for hit-testing or determining if an anchor or guideline is "inside" a glyph outline.

Source: FontLab Proteus API documentation

containsInInclude

containsInInclude(id: Any) -> bool

bool containsInInclude(flShape | uint id)

Returns True if a given shape (or a shape with the given ID) is in this composite's include list. Use before calling include() to avoid duplicate inclusions.

Source: FontLab Proteus API documentation

contentLocked instance-attribute

contentLocked: Any

bool

When True, the shape's contours cannot be edited in the UI. The shape can still be moved or transformed as a whole. Set this programmatically to protect shapes you've placed by script.

Source: FontLab Proteus API documentation

contours instance-attribute

contours: Any

list(flContour)

Direct access to the contour list. Assigning a new list replaces all contours at once. Prefer addContour / removeContour for incremental changes, and use this property for a complete swap.

Source: FontLab Proteus API documentation

contoursCount instance-attribute

contoursCount: Any

int

The number of contours in this shape. Equivalent to len(shape.contours) but faster since it doesn't build a Python list.

Source: FontLab Proteus API documentation

convertToFgShape

convertToFgShape(arg0: fgShape) -> Any

convertToFgShape(fgShape)

Writes this shape's data into an existing fontgate shape object. Used when you need to pass the shape to a lower-level fontgate API.

Source: FontLab Proteus API documentation

copyToFgShape

copyToFgShape(arg0: fgShape) -> Any

copyToFgShape(fgShape)

Like convertToFgShape but performs a full deep copy into the fontgate shape. The resulting fontgate shape is independent of the original.

Source: FontLab Proteus API documentation

createInstance

createInstance() -> flShape

flShape createInstance()

Allocates and returns a fresh, empty shape. Useful when you need a shape instance but are not yet ready to attach it to a layer.

Source: FontLab Proteus API documentation

cutContour

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

(list(flContour) inner, list(flContour) outer)/Nothing cutContour(flContour, QTransform)

Cuts this shape using a contour as a knife, returning two lists: contours inside the knife shape and contours outside. Returns None if the cut fails. Useful for splitting shapes along an arbitrary boundary.

Source: FontLab Proteus API documentation

decomposite

decomposite() -> Any

decomposite()

Flattens all composite children into real contours in place, destroying the composite hierarchy. Use this when you need a plain, editable shape and don't care about preserving the component structure.

Source: FontLab Proteus API documentation

eject

eject(arg0: flShape) -> Any

eject(flShape)

Removes a specific child shape from this composite and releases it as an independent shape. The ejected shape retains its own transform.

Source: FontLab Proteus API documentation

ejectTo

ejectTo(clone: Any = ...) -> Any

list(flShape) ejectTo([bool clone =true[, bool apply_tx =true]])

Breaks the entire composite apart, returning all child shapes as a Python list. If apply_tx=True, each child's transform is baked in so it stays in the same visual position. If clone=True, the children are copied rather than destructively removed.

Source: FontLab Proteus API documentation

ensurePaths

ensurePaths() -> Any

ensurePaths()

Forces FontLab to regenerate all path data for this shape from the current node coordinates. Call this after bulk node edits to make sure the visual representation and bounding boxes are accurate.

Source: FontLab Proteus API documentation

excluded instance-attribute

excluded: Any

bool

When True, this shape is excluded from export. It still appears in the editor but will not appear in the exported font file. Useful for keeping reference artwork or annotations inside a glyph.

Source: FontLab Proteus API documentation

expandStroke

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

bool expandStroke([bool outer_only]) - replace the stroke with its filled outline

findNode

findNode(arg0: str) -> flNode

flNode findNode(QString)

Searches all contours within this shape for a node with the given name. Node names are set in the UI via the Node Properties inspector panel.

Source: FontLab Proteus API documentation

fl_transform instance-attribute

fl_transform: Any

flTransform

The shape's spatial transform expressed as an flTransform object, which includes scale, rotation, and translation with designer-friendly decomposition.

Source: FontLab Proteus API documentation

getActiveComposite

getActiveComposite() -> Any

flShape/Nothing getActiveComposite()

Returns the composite sub-shape that is currently active (selected for editing) within this shape, or None if no sub-shape is active.

Source: FontLab Proteus API documentation

getActiveIncludeShape

getActiveIncludeShape() -> Any

flShape/Nothing getActiveIncludeShape()

Returns the specific included child shape that the user has selected, or None. Helpful for scripts that react to the current UI selection state.

Source: FontLab Proteus API documentation

getAnchorForObject

getAnchorForObject(arg0: flObject) -> Any

flAnchor/Nothing getAnchorForObject(flObject)

Finds the anchor on this shape that is linked to a particular object (a node or guideline). Returns None if no matching anchor exists.

Source: FontLab Proteus API documentation

getAnchors

getAnchors() -> Any

list(flAnchor)/Nothing getAnchors()

Returns all anchors attached to this shape. Anchors are the small diamond-shaped points used for attaching diacritics.

Source: FontLab Proteus API documentation

getCompositesBounding

getCompositesBounding() -> QRectF

QRectF getCompositesBounding()

Computes the combined bounding box across all sub-shapes in a composite. Unlike boundingBox, this traverses the full composite hierarchy.

Source: FontLab Proteus API documentation