Skip to content

fontlab.flLayer · declarations 001

Back to fontlab.flLayer

addAnchor

addAnchor(arg0: flPinPoint) -> Any

addAnchor(flPinPoint)

Appends an already-constructed flPinPoint anchor to this layer. Use this when you have built the anchor object separately (for example, by cloning one from another layer).

Source: FontLab Proteus API documentation

addComponent

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

addComponent(name or (name, QTransform)) creates a live component shape. Use notifyChangesApplied before and after for Undo.

Adds a glyph component (a composite reference to another glyph) to this layer. Components are the basis of composite glyphs like accented characters.

Source: FontLab Proteus API documentation

addShape

addShape(arg0: flShape) -> flShape

flShape addShape(flShape)

Appends the given shape to this layer and returns the added shape. The returned reference is the live version owned by the layer — use it (not the original variable) for any further editing.

Source: FontLab Proteus API documentation

addShapes

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

addShapes(list(flShape))

Appends a list of shapes to this layer in one call. More efficient than calling addShape in a loop when you have many shapes to add at once.

Source: FontLab Proteus API documentation

advanceHeight instance-attribute

advanceHeight: Any

double

The vertical advance height, used when the font supports vertical writing modes. Rarely needed for Latin scripts.

Source: FontLab Proteus API documentation

advanceWidth instance-attribute

advanceWidth: Any

double

The horizontal advance width for this layer — the total space the glyph occupies from origin to the next glyph's origin. Setting this directly sets a numeric value; to set an expression, use the metricsWidth property instead.

Source: FontLab Proteus API documentation

anchors instance-attribute

anchors: Any

list(flPinPoint) anchors()

All anchor pin-points on this layer.

Source: FontLab Proteus API documentation

appendGuidelines

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

appendGuidelines(list(flGuideLine))

Adds a list of guideline objects to this layer in one call. Preserves any existing guidelines already on the layer.

Source: FontLab Proteus API documentation

applyTransform

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

applyTransform(QTransform transform [, bool contours, bool metrics, bool guides, bool anchors])

Applies a geometric transformation to all shapes in this layer, permanently baking the transform into the node coordinates. Without an argument, applies the layer's own transform property.

Source: FontLab Proteus API documentation

assignFgLayer

assignFgLayer(arg0: fgLayer, doGuides: bool, doHints: bool, doAnchors: bool, doShapes: bool, doTTH: bool) -> Any

assignFgLayer(fgLayer, bool doGuides, bool doHints, bool doAnchors, bool doShapes, bool doTTH)

Applies data from a fontgate layer to this layer, selectively importing guides, hints, anchors, shapes, and TrueType data based on the boolean flags.

Source: FontLab Proteus API documentation

assignStyle

assignStyle(layer: flLayer) -> Any

assignStyle(flLayer layer)

Copies display style settings (color, opacity, wireframe mode) from the given layer to this one.

Source: FontLab Proteus API documentation

autoLayer instance-attribute

autoLayer: Any

bool

When True, this layer's content is auto-generated (for example, by an interpolation recipe). Programmatic edits may be overwritten the next time the layer is rebuilt.

Source: FontLab Proteus API documentation

autohint

autohint() -> bool

bool autohint()

Runs FontLab's automatic PostScript hint generator on this layer's outlines. Returns True if hints were successfully generated. A good starting point before manual hint editing.

Source: FontLab Proteus API documentation

bindDependencies

bindDependencies() -> Any

bindDependencies()

Rebuilds the internal dependency links between shapes and components. Call this after programmatically adding or removing components if the layer seems to be in an inconsistent state.

Source: FontLab Proteus API documentation

boundingBox instance-attribute

boundingBox: Any

QRectF boundingBox()

The tight bounding box enclosing all shapes on this layer. Equivalent to the ink bounding box plus any off-curve points. Use inkBox() for a box that excludes off-curve points.

Source: FontLab Proteus API documentation

buildAuto

buildAuto() -> bool

bool buildAuto()

Triggers generation of this layer's content from its recipe (if it is an auto layer). Returns True if the build succeeded.

Source: FontLab Proteus API documentation

checkTags

checkTags(glyph_tags: set[str], item_tags: str) -> bool

bool checkTags(QSet glyph_tags, QString item_tags)

Tests whether a set of glyph tags satisfies a tag-filter expression. Used internally by FontLab's smart filter system, but available if you need the same matching logic in a script.

Source: FontLab Proteus API documentation

cleanEmptyShapes

cleanEmptyShapes() -> Any

cleanEmptyShapes()

Deletes any shapes that have no contours or content. A housekeeping method to keep the model tidy after operations that may leave empty shapes behind.

Source: FontLab Proteus API documentation

clearAnchors

clearAnchors() -> Any

clearAnchors()

Removes all anchors from this layer at once. Use with care — this deletes mark attachment information that may be referenced by other glyphs.

Source: FontLab Proteus API documentation

clearAudit

clearAudit() -> None

void clearAudit()

Clears all recorded audit issues from this layer without re-running the checks.

Source: FontLab Proteus API documentation

clearComponents

clearComponents() -> Any

clearComponents()

Removes all component (composite) shapes from this layer, leaving only drawn shapes.

Source: FontLab Proteus API documentation

cloneCustom

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

(flLayer, list(flObject)) cloneCustom(uint)

Creates a customized clone of this layer using the given flags to control which parts are copied. Returns both the new layer and a list of newly created objects.

Source: FontLab Proteus API documentation

compare

compare(layer: flLayer, error: float) -> bool

bool compare(flLayer layer, double error)

Compares this layer's geometry to another layer, returning True if they are equal within the given tolerance. Useful for detecting whether two masters have accidentally diverged.

Source: FontLab Proteus API documentation

components instance-attribute

components: Any

list(name, transform)

All composite/component shapes (references to other glyphs) on this layer, as name + transform pairs.

Source: FontLab Proteus API documentation

componentsCount instance-attribute

componentsCount: Any

int componentsCount()

The number of component references on this layer.

Source: FontLab Proteus API documentation

compoundMakeSelected

compoundMakeSelected(set_active: bool, process_all: bool) -> bool

bool compoundMakeSelected(bool set_active, bool process_all)

Decomposes the currently selected composite shapes into editable contours on this layer. If set_active is True, the resulting contours become the active selection. If process_all is True, all composites are processed rather than just the selection.

Source: FontLab Proteus API documentation

compoundMakeSelectedToShapes

compoundMakeSelectedToShapes(set_active: Any = ...) -> bool

bool compoundMakeSelectedToShapes([bool set_active =true])

Similar to compoundMakeSelected, but the decomposed result is returned as plain flShape objects rather than raw contours. The shapes are added to the layer and selected if set_active is True.

Source: FontLab Proteus API documentation

compoundReleaseSelected instance-attribute

compoundReleaseSelected: Any

bool compoundReleaseSelected();

True if there are selected composites that can be released (decomposed).

Source: FontLab Proteus API documentation

contourRect

contourRect() -> QRectF

QRectF contourRect()

Returns a bounding rectangle around all contour data, including off-curve control points. Slightly larger than inkBox when curves bulge outside the ink area.

Source: FontLab Proteus API documentation

counterAnchors instance-attribute

counterAnchors: Any

int counterAnchors()

The count of anchors on this layer.

Source: FontLab Proteus API documentation

createAnchor

createAnchor(name: Any, p: QPointF, location: int) -> flPinPoint

flPinPoint createAnchor(string name, QPointF p, int location)

Creates a new named anchor at the given point and adds it to this layer. The location argument controls snapping behavior. This is the recommended way to create anchors programmatically.

Source: FontLab Proteus API documentation

createInstance

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

Native fontlab.flLayer.createInstance; argument details are not documented.

Allocates and returns a fresh, empty layer instance not yet attached to any glyph. Use this when you need to build a layer from scratch before adding it to a glyph.

Source: FontLab Proteus API documentation

deactivateAllShapes

deactivateAllShapes() -> Any

deactivateAllShapes()

Exits per-shape edit mode for all shapes and returns to the layer-level selection state. Call this to ensure a clean state before programmatic operations.

Source: FontLab Proteus API documentation

fillFgAnchors

fillFgAnchors(arg0: fgLayer) -> Any

fillFgAnchors(fgLayer)

Exports this layer's anchor data into a fontgate layer object. Used internally during font export; rarely needed in user scripts.

Source: FontLab Proteus API documentation

fillFgGuides

fillFgGuides(arg0: fgLayer) -> Any

fillFgGuides(fgLayer)

Exports this layer's guideline data into a fontgate layer object. Used internally during font export.

Source: FontLab Proteus API documentation

findAnchor

findAnchor(name: str) -> flPinPoint

flPinPoint findAnchor(QString name)

Searches the layer's anchors for one with the given name and returns it. Returns None if no anchor with that name exists. Use this to look up specific anchors by name rather than iterating the full list.

Source: FontLab Proteus API documentation

findNearestNode

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

(flShape, flNode best_node, double maxd) findNearestNode(QPointF, flNode::NodeType node_type, double maxd)

Finds the node closest to the given canvas point, among nodes of the given type and within maxd units. Returns the owning shape, the node, and the actual distance. Useful for snapping and proximity tests.

Source: FontLab Proteus API documentation

findNode

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

(flNode, QPointF)/Nothing findNode(string name)

Searches all shapes for a node with the given name and returns a tuple of the node and its canvas position. Returns None if no matching node is found.

Source: FontLab Proteus API documentation

getActiveComposite

getActiveComposite() -> Any

flShape/Nothing getActiveComposite()

Returns the composite shape that is currently being edited in exploded mode, or None if no composite is active.

Source: FontLab Proteus API documentation

getActiveShape

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

(flShape, QTransform)/Nothing getActiveShape([bool = true])

Returns a tuple of the currently active shape and its transform, or None if no shape is active. The transform accounts for any composite nesting.

Source: FontLab Proteus API documentation