skillfed

defcon

A set of flexible objects for representing UFO data.

defcon v0.12.2 78.8K downloads/30d#14,409 on PyPI68
Permissive license MIT Active released

What it is and what it does

Defcon is a Python library that provides a set of UFO (Unified Font Object) based classes for representing font data in a way optimized for font editing applications. It implements the UFO3 specification and offers lightweight, fast objects for working with glyphs, contours, and other font components. Rather than trying to be a complete solution, defcon provides bare-bones base functionality so developers can build their own font editing tools on top without managing object observation or cached data themselves.

The library depends on fonttools for core font operations and is designed to integrate into larger font editing workflows. It supports optional extras like fontPens for advanced glyph operations and lxml for faster XML parsing. The project is actively maintained and has been in use since 2016, making it a stable foundation for font tool development.

Use it for:

  • Building custom font editors or design tools that need to read, modify, and write UFO font files.
  • Programmatically generating or manipulating glyphs, contours, and font metadata in font design pipelines.
  • Converting between font formats or performing batch operations on font data using UFO as an intermediate representation.
  • Developing font validation or analysis tools that need structured access to UFO font components.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Defcon provides lightweight, UFO-based objects for font editing applications, implementing the UFO3 format with a focus on fast, flexible base functionality rather than end-all solutions.

Yes. Defcon is a stable, actively maintained library with low install friction and permissive licensing. It is the standard choice for UFO-based font manipulation in Python, with no known security vulnerabilities. Install it if you are building font editing tools or need programmatic access to UFO font data.

Install

defcon on PyPI

pip

pip install defcon

uv

uv add defcon

poetry

poetry add defcon

Installing defcon

Before you install

Low install friction with a single runtime dependency (fonttools). The project is actively maintained with recent commits and has been stable since its 2016 initial release.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute defcon freely provided you include the license notice.

Quickstart

pip install defcon

from defcon import Font

font = Font()
glyph = font.newGlyph('A')
contour = glyph.appendContour()

Requires Python 3.9 or later.

Verify before relying

  • Whether optional extras (fontPens, lxml) are commonly needed for typical font editing workflows.
  • Performance characteristics when working with large font files or complex glyph data.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — fonttools
Maintenance actively maintained — 394 days since the last release
Last repo commit
First released
Downloads 78,781/month — #14,409 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: defcon-0.12.2-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Multimedia :: Graphics :: Editors :: Vector-BasedTopic :: Software Development :: Libraries :: Python Modules

Tags

UFO font object libraryfont editing data structuresUFO3 format implementationlightweight font objectsfont glyph and contour manipulation
font-toolsufo-formattypography

More Python Modules packages