Starting with Glyphs 3.2, it is possible to place multiple plugins in a single .glyphsPlugin
bundle. Thus far, a bundle could only contain a single type of plugin:
.glyphsReporter
.glyphsFilter
.glyphsPalette
.glyphsFileFormat
.glyphsTool
.glyphsPlugin
Now, this differentiation is no longer needed. A .glyphsPlugin
bundle can contain one or more plugin classes.
Single Plugin Class
If your bundle contains just a single plugin, as is commonly the case, you can continue to list the class of that plugin in the Info.plist file of the bundle as before:
<key>NSPrincipalClass</key>
<string>ExamplePluginClass</string>
Multiple Plugin Classes
New in Glyphs 3.2 is the ability to list multiple classes. For that, use the new Principal Classes
key, like so:
<key>Principal Classes</key>
<array>
<string>ExampleReporterClass</string>
<string>ExamplePaletteClass</string>
</array>
In this case, the NSPrincipalClass
key-value pair is ignored.
Instead of one of the more specific bundle file extensions, use .glyphsPlugin
when your bundle contains multiple plugins. In general, .glyphsPlugin
can be used by any bundle, whether it contains a single plugin or multiple plugins.
Use Cases for Multiple Plugin Classes in a Single Bundle
Combining multiple plugins into a single bundle is great for when your plugin makes use of different Glyphs features at the same time: A custom section in the Palette, a custom tool in the toolbar, a custom reporter in the View menu, or maybe even a custom file format. If you have such plugins that depend on each other, then they can now be installed with a single click in the Plugin Manager as one bundle.
The other benefit is that, since multiple plugins can live in the same bundle, they can also share the same utility classes, helper functions, constants, resources, and so on – no need to duplicate these assets across multiple bundles.