Skip to content

fontlab_glyport.plugins.base

base

The seven Glyphs SDK plugin base classes over a plugin host (R025).

They follow GlyphsSDK ObjectWrapper/GlyphsApp/plugins.py: the same defaults in init/loadPlugin, then the optional script hooks settings() and start(); titles from menuName/name; filters call filter(layer, inEditView, customParameters); reporters call foreground/background/inactiveLayerForeground/ inactiveLayerBackground with getScale() set from the paint context. Where the SDK relies on Glyphs' native superclasses, the host does the work: FilterWithDialog.process_ restores each layer from its host snapshot before filtering (Glyphs copies shadowLayers), and loadNib decodes the bundle's NIB/XIB into Qt-backed Cocoa views with this plugin as File's Owner. Exceptions in protocol methods go to the environment's error sink, as the SDK sends them to LogError.

make_plugins_module(env) returns the GlyphsApp.plugins module with classes bound to env.

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
ErrorSink attribute (shared captured text)
PLUGIN_CLASSES attribute
SDK_REEXPORTS attribute
make_plugins_module function (env: PluginEnv, extras: Mapping[str, Any] | None=None) -> ModuleType <code>GlyphsApp.plugins</code><code>: the seven classes bound to </code><code>env</code><code>, SDK helpers and the SDK&#x27;s re-exported Cocoa/GlyphsApp names that glyport provides (</code><code>extras</code>).
pathForResource function (resourceName, extension, path=None) SDK helper: the bundle resource's path, or None when it does not exist.
plugin_image function (qt: Any, plugin: Any, image: Any) -> Any An SDK icon (<code>self.icon</code><code>): an </code><code>NSImage</code><code> as is, or a resource name resolved in the plugin&#x27;s bundle (</code><code>&quot;ExportIcon&quot;</code><code> -&gt; </code><code>ExportIcon.tiff</code>).
plugin_resources function (plugin: Any) -> Path | None The bundle Resources folder of the file defining <code>plugin</code>'s class.
setUpMenuHelper function (menu, items, defaultTarget) -> None SDK helper: add <code>{&quot;name&quot;, &quot;action&quot;, &quot;target&quot;, &quot;state&quot;, &quot;index&quot;}</code> entries.