Skip to main content

FeaComposer

FeaComposer is a wrapper around fontTools.feaLib.ast for programmatically composing code in the FEA format (officially the “OpenType feature file”).

API stability between minor versions is not guaranteed before version 2.

Users are expected to use the fontTools.feaLib.ast classes directly for functionalities that are not yet covered by the FeaComposer API.

The API is designed to be close to the FEA syntax for familiarity, but is tightened up to be more manageable for complicated projects. On the other hand, as an embedded domain-specific language (eDSL) it allows you to take full advantage of Python, especially static type checking.

Do you need this?

For the following use cases, you will not benefit from this package:

  • You just want to write FEA code directly.
  • You want to compose OpenType Layout (OTL) rules in Python code independently from the FEA format. You don’t need static type checking.
    • Try fontFeatures, which allows you to work on the syntax tree of OTL rules rather than the FEA code. It still allows you to export FEA code if you want.
  • You want some Python logic in FEA code. You don’t need the usual code editor experience for Python, or you care about how the FEA code is formatted.
    • Try FeaPyFoFum, which provides a template language for embedding Python inside FEA code.

Getting started

Install from PyPI:

pip install tptq.feacomposer

Note the namespace dot in the “import package” name below has been normalized to a dash in the “distribution package” name above. See also Distribution package vs. import package.

Compose FEA code in Python:

from tptq.feacomposer import FeaComposer

c = FeaComposer(languageSystems={"latn": {"dflt"}})

with c.Lookup(feature="liga"):
    c.sub("f", "i", by="f_i")

print(c.asFeatureFile())

The printed FEA code:

languagesystem latn dflt;
feature liga {
    script latn;
    language dflt;
    lookup _1 {
        lookupflag 0;
        sub f i by f_i;
    } _1;

} liga;

To learn more, see examples.py and its output, examples.fea.

Metadata

Release files for tptq-feacomposer 1.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tptq-feacomposer 1.12.1
File Size Uploaded
tptq_feacomposer-1.12.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tptq-feacomposer 1.12.1
File Interpreter ABI Platform
tptq_feacomposer-1.12.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / tptq_feacomposer-1.12.1.tar.gz

Download URL tptq_feacomposer-1.12.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de3d5d9b5bbed0aaf7ccae4a7b2cbf868812ebbd3bed1a0266e6839042abdd6c
BLAKE2b-256 checksum
How to use checksums
736c946728df7dacb3d530193cf67730aca3ed00f4748edef18a34960d9ec649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / tptq_feacomposer-1.12.1-py3-none-any.whl

Download URL tptq_feacomposer-1.12.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a138d046e11e83f2d985cb887381b8b7a7fd2c7d17c41a2f2137a5f508f2fc0
BLAKE2b-256 checksum
How to use checksums
c10382dbcc567bdb6818634372505992323450a052087707d84b97e84c89ba00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.12.1 This release

2 release files

1.11.3

2 release files

1.5.5

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page