A Python library to load, examine, and save fonts in multiple formats (OpenType, TrueType, UFO, etc.) with a unified object model. Version 3.1.3; released irregularly, with breaking changes in major versions.
pip install babelfontVerified import paths — ran on the pinned version, not inferred.
Load a TrueType font, inspect name and glyphs, then export to UFO.
Use from babelfont import Babelfont or the load function.
Access glyphs by name: font.glyphs['A']. For iteration, use list(font.glyphs.values()).
Disable logging: import logging; logging.getLogger('babelfont').setLevel(logging.ERROR)E.g., use getattr(font, 'variations', None) or font.glyphs['A'].get('width')Switch to the default fonttools backend. Set backend explicitly if needed: load('file', backend='fonttools')