glyphsLib

raw JSON →
6.13.0 verified Mon Apr 27 auth: no python

A Python library that bridges Glyphs source files (.glyphs) to UFOs (Unified Font Object) and back. It converts .glyphs files into UFO packages for further processing (e.g., with fontmake) and can also write back to .glyphs format. The current version is 6.13.0, with a relatively active release cadence (multiple minor releases per year). Requires Python >= 3.10.

pip install glyphslib
error ModuleNotFoundError: No module named 'glyphslib'
cause The library is not installed, or you used the wrong import name (e.g., 'glyphslib' instead of 'glyphslib').
fix
Run pip install glyphslib and ensure correct spelling: import glyphslib.
error AttributeError: module 'glyphslib' has no attribute 'load'
cause You might be using an older version of glyphsLib (pre-6.0) where the load function was in a submodule.
fix
Upgrade to glyphsLib >=6.0: pip install --upgrade glyphslib. Or use from glyphslib.glyphs import load for older versions.
error glyphslib.builder.BuildError: Unsupported custom parameter: ...
cause The .glyphs file contains a custom parameter that glyphsLib does not understand or implement.
fix
Check the parameter name and report an issue. Often it can be safely ignored by passing ignore_unknown_parameters=True (if available) or by removing the parameter from the .glyphs file.
breaking Version 6.0.0 dropped support for Python 3.9 and earlier. If you are on an older Python, you must use an older version of glyphsLib.
fix Upgrade to Python 3.10+ or pin to glyphsLib <6.0.0 (e.g., pip install 'glyphslib<6').
gotcha The .glyphs file format (v2 vs v3) is auto-detected, but some custom parameters or new features in Glyphs 3 may not be fully supported. Always check for warnings or errors during conversion.
fix Use the `validate` function or inspect the logs for unsupported features.
deprecated The `glyphslib.glyphs` submodule (direct .glyphs file parsing) is being deprecated in favor of the higher-level API in `glyphslib` package itself.
fix Use `from glyphslib import load` instead of `from glyphslib.glyphs import load`.
gotcha When converting back to .glyphs (using `to_glyphs`), some UFO features like kerning exceptions or OpenType lookups may not round-trip perfectly. Always verify output.
fix Check the generated .glyphs file in Glyphs.app for fidelity.

Load a .glyphs file and convert it to UFOs using the high-level API.

from glyphslib import load, to_ufos

# Load a .glyphs file
glyphs_data = load('MyFont.glyphs')

# Convert to UFO fonts (list of UFO objects for each master)
ufo_fonts = to_ufos(glyphs_data)

# Now you can work with UFOs using fontTools or ufoLib2
for ufo in ufo_fonts:
    print(ufo.info.familyName)