A tool for comparing font compiler outputs (fontc vs fontmake)
Project description
ttx-diff
A tool for comparing font compiler outputs between fontc (Rust) and fontmake (Python).
Overview
ttx-diff is a helper utility that compares binary font outputs from two different font compilers:
- fontc: The Rust-based font compiler from Google Fonts
- fontmake: The Python-based font compiler
The tool converts each binary font to TTX (XML) format, normalizes expected differences, and provides a detailed comparison summary.
Installation
From PyPI
pip install ttx-diff
From source
git clone https://github.com/googlefonts/fontc.git
cd fontc/ttx_diff
pip install -e .
Requirements
- Python 3.10 or higher
fontcandotl-normalizerbinaries (see below)
All Python dependencies (fontmake, fonttools, etc.) are installed automatically.
Getting fontc and otl-normalizer
The tool needs the fontc and otl-normalizer binaries. You can:
-
Specify paths explicitly (recommended for most users):
ttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer source.glyphs
-
Add them to your PATH: If
fontcandotl-normalizerare in your PATH, they'll be found automatically -
Run from fontc repository: If you run from the fontc repository root, the tool will automatically build the binaries for you
Usage
Note: Unlike the original ttx_diff.py script, this standalone version can be run from any directory. You don't need to be in the fontc repository.
Rebuild with both fontmake and fontc and compare:
ttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer path/to/source.glyphs
If the binaries are in your PATH:
ttx-diff path/to/source.glyphs
Compare two precompiled fonts directly (without building from source):
ttx-diff --fontc_font path/to/fontc.ttf --fontmake_font path/to/fontmake.ttf
This is useful for comparing font differences when you already have both builds.
Rebuild only fontc's font and reuse existing fontmake output:
ttx-diff --rebuild fontc path/to/source.glyphs
Output results in machine-readable JSON format, as used by the fontc_crater tool.
ttx-diff --json path/to/source.glyphs
Compare using gftools build pipeline:
ttx-diff --compare gftools --config config.yaml path/to/source.glyphs
Development
Running tests
pip install -e .[test]
pytest
Running tests with coverage
pytest --cov=ttx_diff --cov-report=html
Releasing
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttx_diff-0.2.1.tar.gz.
File metadata
- Download URL: ttx_diff-0.2.1.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fb562c7d7e62ec74ec993478d910d94c61972f9e5d658cf731974154186843b
|
|
| MD5 |
1b85eb1bb5128f2b450fdf372f9f81b6
|
|
| BLAKE2b-256 |
0273125a77cfc881d37cfa9b00e3b34fbb46f9663877999e1c9854f37b81dfa1
|
Provenance
The following attestation bundles were made for ttx_diff-0.2.1.tar.gz:
Publisher:
python.yml on googlefonts/fontc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ttx_diff-0.2.1.tar.gz -
Subject digest:
3fb562c7d7e62ec74ec993478d910d94c61972f9e5d658cf731974154186843b - Sigstore transparency entry: 713565434
- Sigstore integration time:
-
Permalink:
googlefonts/fontc@81a63d7193a84bf0c09781d67550d15469881a77 -
Branch / Tag:
refs/tags/ttx-diff-v0.2.1 - Owner: https://github.com/googlefonts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@81a63d7193a84bf0c09781d67550d15469881a77 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ttx_diff-0.2.1-py3-none-any.whl.
File metadata
- Download URL: ttx_diff-0.2.1-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a3eedf147f378341c9a64a6310c1f46f07f8d7cc5dc415a06c3031120937f7
|
|
| MD5 |
5894ed1e0b2caa7874b1efdabae689ca
|
|
| BLAKE2b-256 |
ab5b1f34c44b7f9dcccb422c4a2fbd91e8cf78ee99f1eac3f32ff20c59ccd0c9
|
Provenance
The following attestation bundles were made for ttx_diff-0.2.1-py3-none-any.whl:
Publisher:
python.yml on googlefonts/fontc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ttx_diff-0.2.1-py3-none-any.whl -
Subject digest:
07a3eedf147f378341c9a64a6310c1f46f07f8d7cc5dc415a06c3031120937f7 - Sigstore transparency entry: 713565475
- Sigstore integration time:
-
Permalink:
googlefonts/fontc@81a63d7193a84bf0c09781d67550d15469881a77 -
Branch / Tag:
refs/tags/ttx-diff-v0.2.1 - Owner: https://github.com/googlefonts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@81a63d7193a84bf0c09781d67550d15469881a77 -
Trigger Event:
push
-
Statement type: