{"id":22507,"library":"ufo2ft","title":"ufo2ft","description":"A Python library that compiles UFO (Unified Font Object) sources into OpenType font binaries (.otf and .ttf) using FontTools. Version 3.7.1 requires Python >=3.10. It bridges UFO data structures with FontTools' font compilation pipeline, supporting features like Mark-to-Mark positioning, kern feature generation, and variable font instantiation. Release cadence is irregular with patches every few months.","status":"active","version":"3.7.1","language":"python","source_language":"en","source_url":"https://github.com/googlefonts/ufo2ft","tags":["font","opentype","ufo","fonttools","type-design"],"install":[{"cmd":"pip install ufo2ft","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for font compilation and feature processing","package":"fonttools[ufo,lxml,feaLib]","optional":false}],"imports":[{"note":"Top-level import is preferred; direct compiler import may break if internal structure changes.","wrong":"from ufo2ft.compilers import compileInterpolatableFontFromUFOs","symbol":"compileInterpolatableFontFromUFOs","correct":"from ufo2ft import compileInterpolatableFontFromUFOs"},{"note":"","wrong":"","symbol":"compileOTF","correct":"from ufo2ft import compileOTF"},{"note":"","wrong":"","symbol":"compileTTF","correct":"from ufo2ft import compileTTF"}],"quickstart":{"code":"from ufo2ft import compileOTF\nfrom fontTools.ufoLib import UFOReader\n\n# Replace with actual path to your .ufo\npath = \"path/to/font.ufo\"\nreader = UFOReader(path)\nfont = compileOTF(reader)\nfont.save(\"output.otf\")\nprint(\"OpenType font saved.\")","lang":"python","description":"Compile a single UFO into an OpenType font file."},"warnings":[{"fix":"Upgrade to Python 3.10 or higher.","message":"Python 3.9 dropped as of v3.7.0; requires Python >=3.10.","severity":"breaking","affected_versions":">=3.7.0"},{"fix":"Upgrade to v3.6.9 or later, or avoid pinning ufo2ft with exact constraints.","message":"In v3.6.8, dependencies were pinned to exact versions, causing clashes. This was fixed in v3.6.9.","severity":"breaking","affected_versions":"3.6.8 only"},{"fix":"Use top-level imports from ufo2ft package.","message":"Some internal modules like ufo2ft.outlineCompiler may change; rely on stable public API (compileOTF, compileTTF, compileInterpolatableFontFromUFOs).","severity":"deprecated","affected_versions":"all"},{"fix":"Install defcon explicitly if needed: pip install defcon.","message":"ufo2ft works with both defcon and ufoLib2 for UFO objects, but v3.7.0 made neither strictly required. If using defcon, ensure it's installed separately.","severity":"gotcha","affected_versions":">=3.7.0"},{"fix":"Validate master UFOs before compiling with compileInterpolatableFontFromUFOs().","message":"When compiling variable fonts, ensure all master UFOs have the same glyph set and consistent outlines; otherwise compilation may fail silently or produce incorrect data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install ufo2ft' in the correct environment.","cause":"ufo2ft is not installed, or installed in a different Python environment.","error":"ModuleNotFoundError: No module named 'ufo2ft'"},{"fix":"Ensure all master UFOs contain the same set of glyphs (including empty ones if necessary).","cause":"Variable font compilation with inconsistent glyph sets across masters.","error":"ufo2ft.errors.UFO2FTError: missing glyphs in some masters while processing"},{"fix":"Use 'from ufo2ft import compileInterpolatableFontFromUFOs'.","cause":"Wrong function name; the correct function is compileInterpolatableFontFromUFOs.","error":"AttributeError: module 'ufo2ft' has no attribute 'compileInterpolatable'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}