Skip to main content

sr-aef

crates.io docs.rs

sr-aef "uncompiles" an OpenType/TrueType font back into Adobe Feature File (fea) source code. It reads the OpenType layout tables (GSUB, GPOS and, optionally, GDEF) out of a compiled binary font and reconstructs an equivalent feature file using the fea-rs-ast AST.

Because binary fonts lose the original structure of their layout code (lookup splitting, class naming, comments, ...), the output is a faithful functional reconstruction rather than a byte-for-byte copy of the original source.

sr-aef is used by babelfont when compiling a font back to TrueType, and can also be used directly as a "TTF to fea" tool.

Library usage

The main entry points are uncompile, uncompile_bytes, and uncompile_context.

use sr_aef::{fea_rs_ast::AsFea, uncompile_bytes};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let data = std::fs::read("MyFont.ttf")?;
    let feature_file = uncompile_bytes(&data, true)?; // `true` also uncompiles GDEF
    println!("{}", feature_file.as_fea(""));
    Ok(())
}

The returned value is a fea_rs_ast::FeatureFile; call .as_fea() (via the AsFea trait) to render it as feature file text.

For tools that want the component parts rather than a finished feature file, uncompile_context returns an UncompileContext with the reconstructed lookups, classes, mark classes, anchors and language systems, ready to be placed wherever you need them.

Version pinning

sr-aef re-exports the exact versions of fea-rs-ast and skrifa that it is built against (sr_aef::fea_rs_ast and sr_aef::skrifa). If you are already using those crates, prefer the re-exports so that the AST and font-reading types line up with what sr-aef produces.

Command-line usage

A small CLI is available behind the cli feature:

cargo install sr-aef --features cli

or from PyPI:

pip install sr-aef

Print the reconstructed feature file for a font:

sr-aef MyFont.ttf

Dump the intermediate, partially-uncompiled context as JSON (useful for debugging):

sr-aef --debug MyFont.ttf

Status

sr-aef is in early development and its API may change between releases.

License

sr-aef is available under the MIT or Apache-2.0 licenses, at your option. See LICENSE-MIT and LICENSE-APACHE.

Metadata

Release files for sr-aef 0.1.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 sr-aef 0.1.2
File Size Uploaded Provenance Actions
sr_aef-0.1.2.tar.gz 933.1 kB With provenance Details for sr_aef-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sr-aef 0.1.2
File Actions
sr_aef-0.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for sr_aef-0.1.2-py3-none-win_amd64.whl
sr_aef-0.1.2-py3-none-win32.whl Python 3 none Windows x86-32 Details for sr_aef-0.1.2-py3-none-win32.whl
sr_aef-0.1.2-py3-none-musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64 Details for sr_aef-0.1.2-py3-none-musllinux_1_1_x86_64.whl
sr_aef-0.1.2-py3-none-musllinux_1_1_aarch64.whl Python 3 none Linux musl 1.1+ ARM64 Details for sr_aef-0.1.2-py3-none-musllinux_1_1_aarch64.whl
sr_aef-0.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for sr_aef-0.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
sr_aef-0.1.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for sr_aef-0.1.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
sr_aef-0.1.2-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl Python 3 none macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 Details for sr_aef-0.1.2-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 10.0 MB

Release files / sr_aef-0.1.2.tar.gz

Download URL sr_aef-0.1.2.tar.gz
Size 933.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d00f6d0f317b7992bd63b93801c6be9c531cb4ac54d13c361ff37637eb9f38f2
BLAKE2b-256 checksum
How to use checksums
0f897840a6a9e1ddf16c04f2c148279b526339195f36cc6b3a40d116ed59df87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-win_amd64.whl

Download URL sr_aef-0.1.2-py3-none-win_amd64.whl
Size 984.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
267c9990879b92284e5ee64c1bb53126a08d26454f1288db5b41ef7b87e07f33
BLAKE2b-256 checksum
How to use checksums
ca700d510c70b17c7bd598766e7c2669ff558064b44226a6984b56a0f5b86a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-win32.whl

Download URL sr_aef-0.1.2-py3-none-win32.whl
Size 917.0 kB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
a10382f2fdb3f50b61f87690dd18a150ac249a8b6f0989091f8e107fe0bd4988
BLAKE2b-256 checksum
How to use checksums
885f7f3b476768fc85bb71276f14d875cb1d52a4d0d0f2f83a3bb2e663a4dbfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-musllinux_1_1_x86_64.whl

Download URL sr_aef-0.1.2-py3-none-musllinux_1_1_x86_64.whl
Size 1.3 MB
Tags Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5b948f600fc4fe79ae0d3761f23bdcd8cc87f02e614496dcbb834af7c5242b9f
BLAKE2b-256 checksum
How to use checksums
0301a7814c802d09a763306026e9201fdb8dcd83f5d408c202548514f6b70900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-musllinux_1_1_aarch64.whl

Download URL sr_aef-0.1.2-py3-none-musllinux_1_1_aarch64.whl
Size 1.2 MB
Tags Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ca37e7f33b4479dec9a269d4ebcf6e08769257490afd93d6dc2a6a3a2dfd0d66
BLAKE2b-256 checksum
How to use checksums
f32f878b09335bdc6abad4a257a7750a014314410fa123581267bcf7cd09d661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL sr_aef-0.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
909e174b89ee20f0b40dabce1458bad788cf02d9b294062ba530976931230bf2
BLAKE2b-256 checksum
How to use checksums
ee66034118dd0795b8d3f38edb5973f949a14ca0e2872955dfed298025e21b13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL sr_aef-0.1.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
507452e03bd19027aaf2f5e80e0c147007a407fc048c313d8f20dbb6ee4712ad
BLAKE2b-256 checksum
How to use checksums
e10c7bfc1e6093f8ab39baf18196e463fb176b37a99d1355d55900bd3058dec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Release files / sr_aef-0.1.2-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL sr_aef-0.1.2-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 2.2 MB
Tags Python 3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cb7261cb5fb1d6b29ec8aab085715fca6c44806745d6a7c5a886750a55491e0e
BLAKE2b-256 checksum
How to use checksums
1b297f8ea0792a8351ad5a2d1c5078c2704ceea41e2dec07a4ede192ac009881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Security for sr-aef 0.1.2

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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for sr_aef-0.1.2.tar.gz

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 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

8 release files Full provenance

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