RoboFont extensions are Mac OS X packages, folders which act like 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 folders 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

An XML property list file with information about the extension.

A technical specification of the format is available as DTD.

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

Indicating it has a html folder.

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

If set to True, index.html is required in the provided html directory.

integer

not required

launchAtStartUp

Indicating it should execute code during RoboFont start up.

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

integer

not required

mainScript

.py filename path (relative to the lib folder) executed during RoboFont start up.

can be an empty string

string

required when launchAtStartUp is True

uninstallScript

.py filename path (relative to the lib folder) executed while uninstalling the extension.

can be an empty string

string

not required

addToMenu

A list of menu descriptions that should be added to the extension menu.

see Menu Item Description (below)

list

required

timeStamp

The build date of the extension.

float

required

version

The version of the extension

string

required

requiresVersionMajor

The minimum major version for RoboFont requires to install the extension.

string

not required

requiresVersionMinor

The minimum minor version for RoboFont requires to install the extension.

string

not required

com.robofontmechanic.mechanic

A dictionary containing two required keys: summary and repositoryURL. See Mechanic

dictionary

not required

The info.plist can have custom keys if necessary for the extension.

Custom keys should use reverse domain names as keys, to avoid name conflicts with other extensions.

Example: com.myDomain.myExtension.myCustomKey

lib

A folder containing all the .py files needed by the extension.

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

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

When installing the extension, the lib folder is added to sys.path, so all the other files and folders in the extension can be imported with Python as modules. Because of this, it is advised to use reverse domain names without dots to prefix extension modules, to avoid name conflicts with other extensions.

Example: comMyDomainMyExtensionMyModule

html

Not required.

If a html folder is declared in the info.plist, then it should contain a file named index.html. This file should be a plain html file, which will be rendered in RoboFont’s Help Window with WebKit.

resources

The resources folder is a place to keep any other additional files needed for your extension. It is commonly used for assets, such as images for use in toolbar icons and cursors; or for additional compiled command-line tools.

license

Not required.

The license file contains the license for the extension. It can be a .txt or .html file.

requirements.txt

Not required.

The requirements.txt file contains extension names which are required by the extension. For example, an extension which uses DrawBot requires that the DrawBot extension is installed.

Each menu item description is a dictionary with the following keys:

key value
path

.py filename path (relative to the lib folder) to be executed when the menu item is clicked.

string

required

preferredName

The preferred name of the menu item, only be used during display of the menu item.

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 27/03/2018