UFO

Opening UFO2 fonts in RoboFont 3

RoboFont 3 uses UFO3 as its native format. RoboFont 1 used UFO2 with custom additions.

RoboFont 3 opens UFO2 files natively and converts them to UFO3 using the ufoLib.

If opening a UFO2 file fails (for example if it contains invalid data), RoboFont will try to run ufoNormalizer on it first, and then convert the normalized UFO2 font to UFO3.

Both RoboFont and ufoLib provide reports about problems during the conversion process.

Saving to another UFO version

To save an open font as UFO1, UFO2 or UFO3, use the menu File > Save As… to open the Save As sheet:

Then choose the desired UFO version from the drop-down list:

Batch converting between UFO formats

If there are lots of fonts to convert at once, we can use Python to automate the process. Here’s a script to convert all fonts in a folder to a different UFO version:

import os

# a folder containing UFO fonts
folder = '/myFolder'

# the output UFO version
outputVersion = 2

# iterate over all files in the folder
for f in os.listdir(folder):

    # ignore all files which are not UFOs
    if not os.path.splitext(f)[-1] == '.ufo':
        continue

    # open the UFO (without the UI)
    inputPath = os.path.join(folder, f)
    font = OpenFont(inputPath, showInterface=False)

    # save UFO version under a different name
    outputPath = inputPath.replace('.ufo', '_UFO%s.ufo' % outputVersion)
    font.save(path=outputPath, formatVersion=outputVersion)
    font.close()
Last edited on 01/09/2021