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: 2.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 not required.

info.plist

The info.plist is a XML property list 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.

0 (zero) is False, 1 (one) is True.

If set to True, an index.html file is required inside the given html directory.

integer

not required

launchAtStartUp

Indicates if code is executed during RoboFont start up.

0 (zero) is False, 1 (one) is True.

integer

not required

mainScript

Path to the .py file (relative to the lib folder) which is executed during RoboFont start up.

can be an empty string

string

required when launchAtStartUp is True

uninstallScript

Path to the .py file (relative to the lib folder) which is executed while uninstalling the extension.

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

com.robofontmechanic.mechanic

A dictionary containing two required keys: summary and repositoryURL.

(see Mechanic and the note below)

dictionary

deprecated

The info.plist can also include custom keys if necessary.

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 key com.robofontmechanic.mechanic.

This custom key is no longer used in RoboFont 3 / Mechanic 2.

Mechanic 2 introduces a different system for publishing extensions, with extension metadata stored centrally in the Mechanic 2 Server.

See Publishing extensions on Mechanic 2 for more information.

lib

A folder containing 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

If a developer does not want to ship readable source code, it is possible to include only compiled .pyc files in the extension.

These .pyc files must be made with Python 2.7 (built-in).

See the option Collect only .pyc files in Building extensions with the Extension Builder (if you are building the extension manually), or the keyword pycOnly in Building extensions with a script.

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 in .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.

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 .py file (relative to the lib folder) to be executed when the menu item is clicked.

string

required

preferredName

The preferred name of the menu item. Used only when displaying the item in the menu.

string

required

shortKey

string: a single keystroke that can be attached to the menu item.

tuple : (<modifierFlag> integer, <keyStroke> string)

can be an empty string

string or tuple

required

Last edited on 20/11/2018