Extension File Specification ↩
RoboFont extensions are macOS packages – folders which act like single files. They have a standard folder structure and the file extension .roboFontExt
.
You can view the contents of a package by right-clicking it in Finder, and selecting Show Package Contents.
Extension Folder Structure
Version 5.0
Support for
*.pyc
files has been dropped with v4.0
Extension packages must have the following internal structure:
myExtension.robofontExtension ├── info.plist ├── lib │ └── *.py ├── (html) │ ├── index.html │ └── (*.html) ├── (resources) │ └── (any type of file) ├── (license) └── (requirements.txt)
Files and folders in parentheses are optional.
info.plist
The info.plist
is a XML property list file containing extension metadata.
key | value |
---|---|
name
|
Name of the extension. |
string |
|
required |
|
developer
|
Name of the developer. |
string |
|
required |
|
developerURL
|
Site URL of the developer. |
string |
|
required |
|
html
|
Indicates if the extension contains an html folder.
If set to |
integer |
|
not required |
|
launchAtStartUp
|
Indicates if code is executed during RoboFont start up.
|
integer |
|
not required |
|
mainScript
|
Path to the can be an empty string |
string |
|
required when |
|
uninstallScript
|
Path to the can be an empty string |
string |
|
not required |
|
addToMenu
|
A list of menu descriptions for inclusion in the Extension menu. see Menu Item Description (below) can be an empty list |
list |
|
required |
|
timeStamp
|
The extension’s build date. |
float |
|
required |
|
version
|
The extension’s version number. |
string |
|
required |
|
requiresVersionMajor
|
The major version number of the minimum RoboFont version required by the extension. |
string |
|
not required |
|
requiresVersionMinor
|
The minor version number of the minimum RoboFont version required by the extension. |
string |
|
not required |
|
expireDate
|
The expiration date for the extension in the format new in RoboFont 3.3b |
string |
|
not required |
|
com.robofontmechanic.mechanic
|
A dictionary containing two required keys: (see Mechanic and the note below) |
dictionary |
|
deprecated |
Custom keys
The info.plist
may include custom keys if needed.
Custom entries should use reverse domain names as keys to avoid namespace conflicts with other extensions.
Example: com.myDomain.myExtension.myCustomKey
In RoboFont 1, extension metadata for Mechanic was stored in the
info.plist
of each extension under the custom keycom.robofontmechanic.mechanic
.This custom key is no longer used in RoboFont 3 / Mechanic 2.
Mechanic 2 introduces a different system for publishing extensions, with centralized storage of extension metadata in the Mechanic 2 Server.
See Publishing extensions on Mechanic 2 for more information.
lib
The lib
folder contains all .py
files needed by the extension.
When an extension is installed, its lib
folder is added to the sys.path
– so all the other files and folders in the extension can be imported as modules with Python. To avoid namespace conflicts with other extensions, it is recommended to use reverse domain names without dots to prefix extension modules.
Example: comMyDomainMyExtensionMyModule
See the Boilerplate Extension for a working example.
html
not required
If an html folder is declared in the info.plist
, then it must contain a file named index.html
. This file must be a plain html file.
Use the Help link in the extension’s submenu to open the html help in RoboFont’s Help Window (a simple WebKit browser).
resources
not required
The resources
folder is a place to store any additional files needed for your extension. It is commonly used for assets (such as images for toolbar icons and cursors), or for additional compiled command-line tools.
license
not required
The license file contains the full license text for the extension.
This file must be either in .txt
or .html
format.
requirements
not required
The requirements.txt
file contains a list of other extensions which also need to be installed for the current extension to work.
For example, an extension which requires DrawBot and Batch should include a requirements.txt
file with the names of both extensions, one per line:
Batch
DrawBot
Menu Item Description
When installed, an extension can add entries to the Extensions menu. These entries are defined as a list of menu item descriptions.
Each menu item description is a dictionary with the following keys:
key | value |
---|---|
path
|
Path to the |
string | |
required |
|
preferredName
|
The preferred name of the menu item. Used only when displaying the item in the menu. |
string | |
required |
|
shortKey
|
can be an empty string |
string or tuple | |
required |
- Modifier flags are macOS native input masks which can be imported from
AppKit
. See the Boilerplate Extension’s build script for an example.- If no modifiers are given, ⌃ Ctrl and ⌘ Cmd are assigned to the short key.
- If a short key is already in use, it will not be added to the menu item.