fontlab.flVisualItem · declarations 001
acceptEvents
acceptEvents() -> int
int acceptEvents()
Returns the bitmask of event types this specific item accepts.
Source: FontLab Proteus API documentation
activateEditor
activateEditor(canvas_pos: QPointF) -> None
void activateEditor(QPointF canvas_pos)
Activates the inline editing mode at canvas_pos. For a text block, this puts the cursor at the clicked character.
Source: FontLab Proteus API documentation
addedToCanvas
addedToCanvas(arg0: flCanvas) -> None
void addedToCanvas(flCanvas)
Called when this item is first added to a canvas. Override in subclasses to perform initialisation that requires a canvas (e.g. setting initial position).
Source: FontLab Proteus API documentation
adjustCanvasPosition
adjustCanvasPosition(arg0: QPointF) -> QPointF
QPointF adjustCanvasPosition(QPointF)
Snaps the given canvas position to the nearest valid position for this item. Used in tools to constrain drag positions.
Source: FontLab Proteus API documentation
adjustPosition
adjustPosition(double: Any) -> Any
QPointF | double adjustPosition(QPointF | double)
Snaps/clamps a position or distance to valid values.
Source: FontLab Proteus API documentation
appendDecorator
appendDecorator(arg0: flVisualItem, DecoratorOrder: Any) -> None
void appendDecorator(flVisualItem, DecoratorOrder)
Adds a decorator visual item (e.g. a highlight or label overlay) to this item. DecoratorOrder controls whether the decorator is drawn before or after the item itself.
Source: FontLab Proteus API documentation
boundingRectOnCanvas
boundingRectOnCanvas(*args: Any, **kwargs: Any) -> Any
QRectF boundingRectOnCanvas(
Returns the item's bounding rectangle in canvas (screen) coordinates.
Source: FontLab Proteus API documentation
canvas
canvas() -> flCanvas
flCanvas canvas()
Returns the canvas this item lives on, or Nothing if it is not on a canvas.
Source: FontLab Proteus API documentation
clearDecorators
clearDecorators() -> Any
clearDecorators()
Removes all decorator items (highlight overlays, labels, etc.) that have been added to this item. Call this to reset a custom visual overlay you added in a previous frame.
Source: FontLab Proteus API documentation
clearItems
clearItems() -> Any
clearItems()
Removes all child items from this item's item list.
Source: FontLab Proteus API documentation
contain
contain(canvas_pos: QPointF) -> bool
bool contain(QPointF canvas_pos)
Returns True if the given canvas point is inside this item. The primary hit-test method.
Source: FontLab Proteus API documentation
containsItem
containsItem(arg0: flVisualItem) -> bool
bool containsItem(flVisualItem)
Returns True if the given flVisualItem is a child of this item.
Source: FontLab Proteus API documentation
deactivateEditor
deactivateEditor() -> Any
deactivateEditor()
If this item has an active inline editor (e.g. text editing mode), deactivates it and returns to normal display mode.
Source: FontLab Proteus API documentation
distanceTo
distanceTo(arg0: QPointF) -> float
double distanceTo(QPointF)
Returns the distance in canvas pixels from the given point to the nearest edge or feature of this item.
Source: FontLab Proteus API documentation
haveCanvas
haveCanvas() -> bool
bool haveCanvas()
Returns True if this item is currently attached to a canvas. An item not on a canvas has no screen position.
Source: FontLab Proteus API documentation
haveEditor
haveEditor(canvas_pos: QPointF) -> bool
bool haveEditor(QPointF canvas_pos)
Returns True if clicking at canvas_pos would activate an inline editor for this item.
Source: FontLab Proteus API documentation
hide
hide() -> Any
hide()
Makes this item invisible without removing it from the canvas. The item can be made visible again with show().
Source: FontLab Proteus API documentation
hovered
instance-attribute
hovered: Any
bool
Whether the mouse cursor is currently over this item. Read-only in practice (the engine sets it during mouse move).
Source: FontLab Proteus API documentation
instanceAcceptEvents
instanceAcceptEvents() -> int
int instanceAcceptEvents()
Returns the default event acceptance bitmask for all instances of this class. Each bit represents a type of event (mouse, keyboard, etc.) the class can handle.
Source: FontLab Proteus API documentation
invselect
invselect() -> Any
invselect()
Inverts the selection state: selects the item if it was unselected, deselects it if it was selected.
Source: FontLab Proteus API documentation
isSelectable
isSelectable() -> bool
bool isSelectable()
Returns True if this item can be selected by the user with a click. Locked items return False.
Source: FontLab Proteus API documentation
isStableSelect
isStableSelect() -> bool
bool isStableSelect()
Returns True if this item's selection state is stable across canvas refreshes (i.e. won't spontaneously deselect).
Source: FontLab Proteus API documentation
itemScale
itemScale() -> float
double itemScale()
Returns the canvas zoom scale as experienced by this item. Useful for drawing decorators at a consistent screen size regardless of zoom.
Source: FontLab Proteus API documentation
locked
instance-attribute
locked: Any
bool
If True, the item is not interactive — it won't respond to clicks or drags.
Source: FontLab Proteus API documentation
mapCanvasDistanceToItem
mapCanvasDistanceToItem(arg0: QPointF) -> QPointF
QPointF mapCanvasDistanceToItem(QPointF)
Converts a distance vector from canvas space into this item's local coordinate space.
Source: FontLab Proteus API documentation
mapCanvasToItem
mapCanvasToItem(QRectF: Any) -> Any
QPointF | QRectF mapCanvasToItem(QPointF | QRectF)
Maps a point or rectangle from canvas coordinates to this item's local coordinates. Essential for hit-testing inside a transformed item.
Source: FontLab Proteus API documentation
mapItemToCanvas
mapItemToCanvas(QRectF: Any) -> Any
QPointF | QRectF mapItemToCanvas(QPointF | QRectF)
Maps a point or rectangle from the item's local coordinates to canvas coordinates. Use this when drawing overlays over a specific item.
Source: FontLab Proteus API documentation
metricStep
metricStep() -> float
double metricStep()
Returns the metric grid step this item uses for alignment and snapping.
Source: FontLab Proteus API documentation
move
move(arg0: QPointF) -> None
void move(QPointF)
Moves this item on the canvas by the given offset vector (in canvas coordinates).
Source: FontLab Proteus API documentation
opacity
instance-attribute
opacity: Any
double
The transparency of this item. 0.0 = fully transparent (invisible), 1.0 = fully opaque. Useful for fade-in/out animations in decorator tools.
Source: FontLab Proteus API documentation
owner
instance-attribute
owner: Any
flVisualItem
The parent item in the visual hierarchy. For a shape inside a glyph, the owner is the glyph info.
Source: FontLab Proteus API documentation
paint
paint(*args: Any, **kwargs: Any) -> Any
void paint(QPainter*)
Renders this item using the provided QPainter. Called during the canvas paint cycle. Override in custom flVisualItem subclasses to draw custom visuals.
Source: FontLab Proteus API documentation
preview
preview() -> Any
preview()
Forces a repaint of this item on the canvas without changing any model data. Use this to show a temporary visual state (e.g. a hover highlight) without committing a change.
Source: FontLab Proteus API documentation
referencePoint
referencePoint() -> QPointF
QPointF referencePoint()
Returns the reference point (origin or pivot) of this item in canvas coordinates. For shapes this is typically the bottom-left of the bounding box.
Source: FontLab Proteus API documentation
removeDecorator
removeDecorator(arg0: flVisualItem) -> None
void removeDecorator(flVisualItem)
Removes a decorator that was previously added with appendDecorator.
Source: FontLab Proteus API documentation
removeItem
removeItem(arg0: flVisualItem) -> None
void removeItem(flVisualItem)
Removes a child item.
Source: FontLab Proteus API documentation
removedFromCanvas
removedFromCanvas() -> Any
removedFromCanvas()
Called by the engine when this item is removed from its canvas. Override in subclasses to perform cleanup (e.g. disconnecting signals, releasing resources).
Source: FontLab Proteus API documentation
select
select() -> Any
select()
Selects this item. Equivalent to setting selected = True.
Source: FontLab Proteus API documentation
selected
instance-attribute
selected: Any
bool
Whether this item is currently selected.
Source: FontLab Proteus API documentation
show
show() -> Any
show()
Makes this item visible.
Source: FontLab Proteus API documentation