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

The normalized package name “tptq-feacomposer” appears on PyPI. These two forms are equivalent for package management, but only “tptq.feacomposer” works for importing.

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.2

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.2
File Size Uploaded
tptq_feacomposer-1.12.2.tar.gz 4.9 kB Details

Built distribution (wheel)

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

Total release size: 10.9 kB

Release files / tptq_feacomposer-1.12.2.tar.gz

Download URL tptq_feacomposer-1.12.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
268f5fa2d48f1cb814168fbf996de88daf4d563934e2104a4857aca2a8f2ef8d
BLAKE2b-256 checksum
How to use checksums
d21fb66f9f49388911b12a4767d0cf3f062046d36999bb507a4d484d44106663
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.2-py3-none-any.whl

Download URL tptq_feacomposer-1.12.2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea28d7f511a2fb9d07d2484ac8d2fbeeecf126cc56548f25d6f8e1349d4a909e
BLAKE2b-256 checksum
How to use checksums
93f886997ecbef7a83b7f3b3fc7e177539db24b85dfdcacf658d946d11fb5cce
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.2 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