glyphsLib

This Python 3.6+ library provides a bridge from Glyphs source files (.glyphs) to UFOs and Designspace files via defcon and designspaceLib.

The main methods for conversion are found in __init__.py . Intermediate data can be accessed without actually writing UFOs, if needed.

Write and return UFOs The following code will write UFOs and a Designspace file to disk. import glyphsLib master_dir = "master_ufos" ufos , designspace_path = glyphsLib . build_masters ( "MyFont.glyphs" , master_dir ) If you want to interpolate instances, please use fontmake instead. It uses this library under the hood when dealing with Glyphs files.

Load UFO objects without writing import glyphsLib ufos = glyphsLib . load_to_ufos ( "MyFont.glyphs" )

Read and write Glyphs data as Python objects from glyphsLib import GSFont font = GSFont ( glyphs_file ) font . save ( glyphs_file ) The glyphsLib.classes module aims to provide an interface similar to Glyphs.app’s Python Scripting API. Note that currently not all the classes and methods may be fully implemented. We try to keep up to date, but if you find something that is missing or does not work as expected, please open a issue.