fontlab_glyport.plugins.tool_bridge
tool_bridge
A Glyphs SelectTool as a FontLab Python tool (registerPythonTool).
FontLab calls the bridge with Qt events of a glyph canvas viewport:
mousePressed/Moved/Released/DoubleClicked(event, canvas),
keyPressed/Released(event, canvas) and activate/deactivate. The
bridge makes the Glyphs call: mouseDown_, mouseDragged_ (a move with
a button down) or mouseMoved_, mouseUp_, mouseDoubleDown_ (else
mouseDown_ with clickCount() == 2), keyDown_ and keyUp_.
The NSEvent is copied eagerly: FontLab invalidates the Qt event after the
call. While a call runs, Glyphs.currentEvent() is that event, and
tool.editViewController().graphicView() maps it to glyph units of the
active glyph (getActiveLocation_) through App's paint-context maths.
A mouse event is handled (FontLab's own tool skips it) only when the plugin
overrides the method. Keys are delivered but never claimed: FontLab also
sends ShortcutOverride as keyPressed, and claiming it would swallow
every menu shortcut while the tool is active.
activate/deactivate run the loader's callbacks (which add and remove
the tool's foreground/background painters) and the SDK's
willActivate/willDeactivate. Every plugin call goes through guard,
and no exception from any callback reaches FontLab: it goes to sink.
Classes
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
overrides |
function | (tool: Any, name: str) -> bool |
True when <code>tool</code><code>'s class defines </code><code>name</code> beyond Glyport's no-op. |