Skip to main content

Type stubs for FontForge's Python modules

Project description

fontforge-stubs

This package provides PEP 561 type stubs and docstrings for FontForge's Python modules:

  • fontforge
  • psMat

The stubs and docstrings were created by referencing the official FontForge Python Module documentation and -- when necessary -- the FontForge Python extension source code.

Motivation

FontForge provides powerful Python C extension modules. By nature, they do not contain typing information. Combined with inconsistent naming conventions and at times ambiguous documentation, FontForge Python scripting is unnecessarily arduous.

Perhaps you can relate to:

  • Never remembering if it's glyph.name, glyph.glyphName, or glyph.glyph_name
  • Reading the docs and still not knowing whether width is an int or a float
  • Parsing and re-parsing the documentation to figure out the structure of a feature-script-lang tuple

With type stubs, editors can provide autocompletion, and type checkers can identify errors previously only discovered when running your script with FontForge. Built-in documentation removes the need to constantly switch between your editor and external documentation -- further increasing productivity.

Installation

Install the package in your development environment:

pip install fontforge-stubs

Your editor/type-checker should automatically pick up the stubs.

Versioning and Compatibility

This project uses YYYY.MM.DD calendar versioning.

It aims to be compatible with FontForge 20230101 and later. Legacy and deprecated FontForge Python APIs are not officially supported.

Updates to the FontForge Python APIs since the latest offical release (currently 20251009) are kept in the fontforge-next branch until the next upstream release. If you are using a newer build, you may want to install from fontforge-next:

pip install git+https://github.com/chanicpanic/fontforge-stubs@fontforge-next

Contributing

If you find any issues with the type stubs, please open an issue and/or pull request.

License

This project is under the MIT License.

The stubs and docstrings in this project were closely derived from the FontForge source. In particular, fontforge.rst, psMat.rst, and python.c. See NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fontforge_stubs-2025.12.1.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fontforge_stubs-2025.12.1-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file fontforge_stubs-2025.12.1.tar.gz.

File metadata

  • Download URL: fontforge_stubs-2025.12.1.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fontforge_stubs-2025.12.1.tar.gz
Algorithm Hash digest
SHA256 6f803189aa447fb93004425281ee3e47b008cbed0df450b5d5833d6c0a4fe151
MD5 4e6faf8fd23f0d1e81db31a0486a33d4
BLAKE2b-256 64e93f6c6159810a6ae49fc1d1d64c9e4f2c8cd0f01559af765e65d403705a96

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontforge_stubs-2025.12.1.tar.gz:

Publisher: publish.yaml on chanicpanic/fontforge-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontforge_stubs-2025.12.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fontforge_stubs-2025.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f60b3e5d73a7564af3fa461eb124252e38bc3f8419fd35acae89d3cc23e55a69
MD5 21abf0cd2c8281eacdcc2e6b47ff7ccd
BLAKE2b-256 d0ef2cd72682f362f2f69ddd45361f5f0d30031969ba0b3e2e7a0f80e32b698f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontforge_stubs-2025.12.1-py3-none-any.whl:

Publisher: publish.yaml on chanicpanic/fontforge-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page