ttx-diff


Namettx-diff JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA tool for comparing font compiler outputs (fontc vs fontmake)
upload_time2025-10-24 18:40:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords fonts font-compilation fontc fontmake testing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ttx-diff

[![PyPI](https://img.shields.io/pypi/v/ttx-diff)](https://pypi.org/project/ttx-diff/)
[![Python Version](https://img.shields.io/pypi/pyversions/ttx-diff)](https://pypi.org/project/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

```bash
pip install ttx-diff
```

### From source

```bash
git clone https://github.com/googlefonts/fontc.git
cd fontc/ttx_diff
pip install -e .
```

## Requirements

- Python 3.10 or higher
- `fontc` and `otl-normalizer` binaries (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:

1. **Specify paths explicitly** (recommended for most users):
   ```bash
   ttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer source.glyphs
   ```

2. **Add them to your PATH**: If `fontc` and `otl-normalizer` are in your PATH, they'll be found automatically

3. **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:

```bash
ttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer path/to/source.glyphs
```

If the binaries are in your PATH:

```bash
ttx-diff path/to/source.glyphs
```

Rebuild only fontc's font and reuse existing fontmake output:

```bash
ttx-diff --rebuild fontc path/to/source.glyphs
```

Output results in machine-readable JSON format, as used by the [`fontc_crater`](https://github.com/googlefonts/fontc/tree/main/fontc_crater) tool.

```bash
ttx-diff --json path/to/source.glyphs
```

Compare using gftools build pipeline:

```bash
ttx-diff --compare gftools --config config.yaml path/to/source.glyphs
```

## Development

Running tests

```bash
pip install -e .[test]
pytest
```

Running tests with coverage

```bash
pytest --cov=ttx_diff --cov-report=html
```

## Releasing

See <https://googlefonts.github.io/python#make-a-release>.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ttx-diff",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "fonts, font-compilation, fontc, fontmake, testing",
    "author": null,
    "author_email": "Google Fonts <fonts@google.com>",
    "download_url": "https://files.pythonhosted.org/packages/dd/a9/4927e7087a7ac404513206a05dc1a3a5b68c2a960ce76e23eeb354280791/ttx_diff-0.1.0.tar.gz",
    "platform": null,
    "description": "# ttx-diff\n\n[![PyPI](https://img.shields.io/pypi/v/ttx-diff)](https://pypi.org/project/ttx-diff/)\n[![Python Version](https://img.shields.io/pypi/pyversions/ttx-diff)](https://pypi.org/project/ttx-diff/)\n\nA tool for comparing font compiler outputs between fontc (Rust) and fontmake (Python).\n\n## Overview\n\n`ttx-diff` is a helper utility that compares binary font outputs from two different font compilers:\n- **fontc**: The Rust-based font compiler from Google Fonts\n- **fontmake**: The Python-based font compiler\n\nThe tool converts each binary font to TTX (XML) format, normalizes expected differences, and provides a detailed comparison summary.\n\n## Installation\n\n### From PyPI\n\n```bash\npip install ttx-diff\n```\n\n### From source\n\n```bash\ngit clone https://github.com/googlefonts/fontc.git\ncd fontc/ttx_diff\npip install -e .\n```\n\n## Requirements\n\n- Python 3.10 or higher\n- `fontc` and `otl-normalizer` binaries (see below)\n\nAll Python dependencies (fontmake, fonttools, etc.) are installed automatically.\n\n### Getting fontc and otl-normalizer\n\nThe tool needs the `fontc` and `otl-normalizer` binaries. You can:\n\n1. **Specify paths explicitly** (recommended for most users):\n   ```bash\n   ttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer source.glyphs\n   ```\n\n2. **Add them to your PATH**: If `fontc` and `otl-normalizer` are in your PATH, they'll be found automatically\n\n3. **Run from fontc repository**: If you run from the fontc repository root, the tool will automatically build the binaries for you\n\n## Usage\n\n**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.\n\nRebuild with both fontmake and fontc and compare:\n\n```bash\nttx-diff --fontc_path /path/to/fontc --normalizer_path /path/to/otl-normalizer path/to/source.glyphs\n```\n\nIf the binaries are in your PATH:\n\n```bash\nttx-diff path/to/source.glyphs\n```\n\nRebuild only fontc's font and reuse existing fontmake output:\n\n```bash\nttx-diff --rebuild fontc path/to/source.glyphs\n```\n\nOutput results in machine-readable JSON format, as used by the [`fontc_crater`](https://github.com/googlefonts/fontc/tree/main/fontc_crater) tool.\n\n```bash\nttx-diff --json path/to/source.glyphs\n```\n\nCompare using gftools build pipeline:\n\n```bash\nttx-diff --compare gftools --config config.yaml path/to/source.glyphs\n```\n\n## Development\n\nRunning tests\n\n```bash\npip install -e .[test]\npytest\n```\n\nRunning tests with coverage\n\n```bash\npytest --cov=ttx_diff --cov-report=html\n```\n\n## Releasing\n\nSee <https://googlefonts.github.io/python#make-a-release>.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tool for comparing font compiler outputs (fontc vs fontmake)",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/googlefonts/fontc",
        "Issues": "https://github.com/googlefonts/fontc/issues",
        "Repository": "https://github.com/googlefonts/fontc"
    },
    "split_keywords": [
        "fonts",
        " font-compilation",
        " fontc",
        " fontmake",
        " testing"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2f5d6bd3f5fdd249c09ccf45f039729ab63c554b5b8d541567449e4e5ac2f633",
                "md5": "63fc0e5bd50d99e10c54235536734782",
                "sha256": "67ac71d9a15261167c20eecd857ade1936cbce2818549e5e16fd8e9d1fb24597"
            },
            "downloads": -1,
            "filename": "ttx_diff-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63fc0e5bd50d99e10c54235536734782",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 20254,
            "upload_time": "2025-10-24T18:40:46",
            "upload_time_iso_8601": "2025-10-24T18:40:46.929728Z",
            "url": "https://files.pythonhosted.org/packages/2f/5d/6bd3f5fdd249c09ccf45f039729ab63c554b5b8d541567449e4e5ac2f633/ttx_diff-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dda94927e7087a7ac404513206a05dc1a3a5b68c2a960ce76e23eeb354280791",
                "md5": "26e4d8bff37c1003dbde46c518289b6a",
                "sha256": "13eeba47f0f515b084419348c6c6f2988faa1b2e49e205f586adffeebde6be1a"
            },
            "downloads": -1,
            "filename": "ttx_diff-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "26e4d8bff37c1003dbde46c518289b6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22035,
            "upload_time": "2025-10-24T18:40:48",
            "upload_time_iso_8601": "2025-10-24T18:40:48.406406Z",
            "url": "https://files.pythonhosted.org/packages/dd/a9/4927e7087a7ac404513206a05dc1a3a5b68c2a960ce76e23eeb354280791/ttx_diff-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-24 18:40:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "googlefonts",
    "github_project": "fontc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ttx-diff"
}
        
Elapsed time: 2.42762s