Skip to content

fontlab.flLayer · declarations 003

Back to fontlab.flLayer

isImgLayer instance-attribute

isImgLayer: Any

bool isImgLayer()

True if this is a dedicated image layer (as opposed to a drawing layer that happens to contain an image).

Source: FontLab Proteus API documentation

isLocked instance-attribute

isLocked: Any

bool

When True, the layer is locked and cannot be edited in the UI. Set to True to protect a layer from accidental edits while working on another.

Source: FontLab Proteus API documentation

isLockedI instance-attribute

isLockedI: Any

bool isLockedI()

The inherited lock state — True if this layer is locked either directly or because a parent is locked.

Source: FontLab Proteus API documentation

isMaskLayer instance-attribute

isMaskLayer: Any

bool isMaskLayer()

True if this is a mask layer. Mask layers are used as hinting reference overlays.

Source: FontLab Proteus API documentation

isMasterLayer instance-attribute

isMasterLayer: Any

bool isMasterLayer()

True if this layer corresponds to a design-space master and participates in interpolation.

Source: FontLab Proteus API documentation

isService instance-attribute

isService: Any

bool

When True, this is a service (non-printing) layer. Service layers appear in the editor but are excluded from export.

Source: FontLab Proteus API documentation

isServiceMA instance-attribute

isServiceMA: Any

bool isServiceMA()

True for service-with-masters layers — service layers that are associated with specific masters.

Source: FontLab Proteus API documentation

isVisible instance-attribute

isVisible: Any

bool

Controls whether this layer is shown in the glyph editor. Setting to False hides the layer without removing it.

Source: FontLab Proteus API documentation

isVisibleA instance-attribute

isVisibleA: Any

bool isVisibleA()

The accumulated (inherited) visibility — True only if both this layer and all its parent containers are visible.

Source: FontLab Proteus API documentation

isWireframe instance-attribute

isWireframe: Any

bool

When True, this layer is rendered in wireframe mode (outline only, no fill) in the editor. Useful for overlay comparisons.

Source: FontLab Proteus API documentation

killAuto

killAuto() -> Any

killAuto()

Removes the auto-generated content from this layer, converting it back to a manually editable layer.

Source: FontLab Proteus API documentation

lib instance-attribute

lib: Any

dict(name, QVariant)

An arbitrary metadata dictionary attached to this layer, compatible with UFO's lib concept. Useful for storing script-specific data that travels with the layer.

Source: FontLab Proteus API documentation

mark instance-attribute

mark: Any

double

A numeric color mark used to visually flag this layer in the font window. The value maps to a color in FontLab's mark color palette.

Source: FontLab Proteus API documentation

metricsLeft instance-attribute

metricsLeft: Any

QString

The left sidebearing expression for this layer — a string like "=H" or "=@group_name" that links this glyph's LSB to another glyph or group. An empty string means no expression is set (use a numeric value).

Source: FontLab Proteus API documentation

metricsRight instance-attribute

metricsRight: Any

QString

The right sidebearing expression. Works the same way as metricsLeft but controls the RSB.

Source: FontLab Proteus API documentation

metricsWidth instance-attribute

metricsWidth: Any

QString

The width expression. Works the same way but controls the total advance width.

Source: FontLab Proteus API documentation

name instance-attribute

name: Any

object name

The name of this layer, which matches the master name for master layers (e.g. "Light", "Bold"). Setting this renames the layer in the editor.

Source: FontLab Proteus API documentation

nodesCount

nodesCount() -> int

int nodesCount()

Returns the total number of on-curve and off-curve nodes across all shapes and contours in this layer. A quick complexity check.

Source: FontLab Proteus API documentation

note instance-attribute

note: Any

QString

A freeform text note you can attach to this layer. Useful for leaving editorial comments — for example, "spacing adjusted 2024-03" or "needs review for optical correction".

Source: FontLab Proteus API documentation

opacity instance-attribute

opacity: Any

double

The display opacity of this layer in the editor, from 0.0 (invisible) to 1.0 (fully opaque). Does not affect export.

Source: FontLab Proteus API documentation

prepareTransformationData

prepareTransformationData() -> Any

prepareTransformationData()

Caches transformation geometry for this layer in preparation for a batch transform operation. Call before applyTransform in performance-sensitive scripts.

Source: FontLab Proteus API documentation

recipe instance-attribute

recipe: Any

QString

The recipe string used to auto-build this layer's content. Relevant only for auto layers.

Source: FontLab Proteus API documentation

removeAllShapes

removeAllShapes(shape_type: Any = ...) -> Any

removeAllShapes([ShapeType shape_type=AnyShape])

Removes all shapes from the layer. You can pass a ShapeType constant to remove only shapes of a specific type — for example, removing only composite shapes while keeping drawn contours.

Source: FontLab Proteus API documentation

removeAnchor

removeAnchor(arg0: flPinPoint) -> Any

removeAnchor(flPinPoint)

Removes the given anchor from this layer. The anchor object still exists in memory but is no longer part of the layer.

Source: FontLab Proteus API documentation

removeGuides

removeGuides(horizontal: bool, vertical: bool) -> bool

bool removeGuides(bool horizontal, bool vertical)

Removes guidelines by orientation. Pass True for horizontal to remove horizontal guidelines, True for vertical to remove vertical ones, or both True to clear all. Returns True on success.

Source: FontLab Proteus API documentation

removeHints

removeHints(horizontal: bool, vertical: bool) -> bool

bool removeHints(bool horizontal, bool vertical)

Removes PS hints by direction. Pass True for the directions you want to clear. For example, removeHints(True, False) removes only horizontal hints (those controlling stem heights), leaving vertical hints intact.

Source: FontLab Proteus API documentation

removeShape

removeShape(recursive: Any = ...) -> Any

removeShape(flShape[, bool recursive=true])

Removes the given shape from this layer. If recursive is True (the default), the shape is also removed from any composites or component references that pointed to it, keeping the model consistent.

Source: FontLab Proteus API documentation

reorderShapes

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

reorderShapes(QList)

Reorders the layer's shapes by supplying a new sequence of shape IDs. The list must contain every shape ID currently in the layer — this is a full permutation, not a partial reorder.

Source: FontLab Proteus API documentation

replaceShape

replaceShape(old_shape: flShape, new_shape: flShape) -> Any

replaceShape(flShape old_shape, flShape new_shape)

Swaps old for new in place, preserving its position in the z-order. Useful when you want to substitute a shape (for example, replacing a manually drawn counter with a generated one) without disturbing the stacking order.

Source: FontLab Proteus API documentation

resetInkBox

resetInkBox() -> Any

resetInkBox()

Clears the cached ink bounding box, forcing it to be recalculated on the next access. Call this after programmatically moving nodes if you need an up-to-date inkBox immediately.

Source: FontLab Proteus API documentation

resetMetricsLeft

resetMetricsLeft() -> Any

resetMetricsLeft()

Clears any left-sidebearing expression set on this layer, reverting to a plain numeric value. Use this when you want to break a metrics link and edit the LSB freely.

Source: FontLab Proteus API documentation

resetMetricsRight

resetMetricsRight() -> Any

resetMetricsRight()

Clears any right-sidebearing expression, reverting to a numeric RSB. Breaks the link to any group or reference glyph.

Source: FontLab Proteus API documentation

resetMetricsWidth

resetMetricsWidth() -> Any

resetMetricsWidth()

Clears any width expression, reverting to a numeric advance width. Use before setting advanceWidth directly if an expression was previously set.

Source: FontLab Proteus API documentation

resetTransformationData

resetTransformationData() -> Any

resetTransformationData()

Clears the cached transformation geometry. Call after a batch transform is complete to free memory.

Source: FontLab Proteus API documentation

selectAll

selectAll() -> Any

selectAll()

Selects all shapes and all nodes in this layer. Equivalent to pressing Cmd+A in the glyph editor.

Source: FontLab Proteus API documentation

sendToBack

sendToBack(arg0: flShape) -> bool

bool sendToBack(flShape)

Moves the given shape to the bottom of the z-order. Returns True on success.

Source: FontLab Proteus API documentation

sendToFront

sendToFront(arg0: flShape) -> bool

bool sendToFront(flShape)

Moves the given shape to the top of the z-order. Returns True on success.

Source: FontLab Proteus API documentation

setActive

setActive() -> Any

setActive()

Makes this layer the active layer for its parent glyph in the editor. Subsequent editing operations will target this layer.

Source: FontLab Proteus API documentation

setActiveShape

setActiveShape(arg0: flShape) -> Any

setActiveShape(flShape)

Marks a specific shape as the currently active (selected/edited) shape in the UI. Useful when your script wants to focus the editor on a particular shape after making changes.

Source: FontLab Proteus API documentation

setAllShapesSelected

setAllShapesSelected(bool: Any) -> Any

setAllShapesSelected(bool)

Selects or deselects all shapes on this layer at once.

Source: FontLab Proteus API documentation