Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CI Status Crates.io

fontc

Wherein we pursue oxidizing fontmake. For context around where fontmake came from see Mr B goes to Vartown.

Converts source to IR, and then IR to font binary. Aims to be safe and fast.

References

  • Intermediate Representation (IR)
  • Editor perspective note from Just
  • Units
    • Fonts have all the best units; distinguishing between them turns out to matter.

But why?

Two main reasons:

  1. Speed
    • The python compiler is too slow and we don't think we can plausibly make it fast enough
  2. A key part of Google Fonts technical strategy is to get off both Python and C++, consolidating on Rust

So, Rust compiler time!

image

(https://xkcd.com/303/ remix)

Are we there yet?

https://googlefonts.github.io/fontc_crater/ tracks our progress in making the new compiler match the old one.

Getting started

Install the latest version of Rust, https://www.rust-lang.org/tools/install.

Build a simple test font

# Build a .designspace file
$ cargo run -p fontc -- resources/testdata/wght_var.designspace

# Build a .glyphs file
$ cargo run -p fontc -- resources/testdata/glyphs3/WghtVar.glyphs

# Build a .fontra file
$ cargo run -p fontc -- resources/testdata/fontra/minimal.fontra

Emit debug output

If you pass the --emit-debug option, additional files that can be helpful when troubleshooting are written to a debug directory inside the build working directory.

$ cargo run -p fontc -- --emit-debug resources/testdata/wght_var.designspace
$ ls build/debug/

Sources to play with

Google Fonts has lots, you could try https://github.com/rsheeter/google_fonts_sources to get some. Once you have them you could try building them:

cargo run -p fontc -- ../google_fonts_sources/sources/ofl/notosanskayahli/sources/NotoSansKayahLi.designspace

Building lots of fonts at once

There is an included fontc_crater tool that can download and compile multiple fonts at once; this is used for evaluating the compiler. For more information, see fontc_crater/README.md.

Plan

We focus on making the compiler better and more robust, ensuring it can handle the full variety of font sources in the Google Fonts ecosystem.

Our progress is tracked via fontc_crater, which compares fontc against fontmake for thousands of fonts.

Key milestones reached:

We are currently:

  • Ensuring ever more font families compile correctly and match fontmake output (or differ in well-understood ways).
  • Moving towards using fontc exclusively for all Google Fonts builds.

For context see https://github.com/googlefonts/oxidize/blob/main/text/2022-07-25-PROPOSAL-build-glyphs-in-rust.md and the discussion on https://github.com/googlefonts/oxidize/pull/33.

Using a local copy of fontations

It is quite common to find we need changes in https://github.com/googlefonts/fontations to add a feature or fix a bug. Prior to a release being available modify the root Cargo.toml to point to either a local clone or a branch:

# Local copy
[patch.crates-io]
font-types =  { path = "../fontations/font-types" }
read-fonts =  { path = "../fontations/read-fonts" }
write-fonts = { path = "../fontations/write-fonts" }
skrifa =  { path = "../fontations/skrifa" }

# Branch
[patch.crates-io]
font-types = { git="https://github.com/googlefonts/fontations.git", branch="box" }
read-fonts = { git="https://github.com/googlefonts/fontations.git", branch="box" }
write-fonts = { git="https://github.com/googlefonts/fontations.git", branch="box" }
skrifa = { git="https://github.com/googlefonts/fontations.git", branch="box" }

Dependency map

Shows the non-dev dependency relationships among the crates in the repo.

%% This is a map of non-dev font-related dependencies.
%% See https://mermaid.live/edit for a lightweight editing environment for
%% mermaid diagrams.
graph
    %% First we define the nodes and give them short descriptions.
    %% We group them into subgraphs by repo so that the visual layout
    %% maps to the source layout, as this is intended for contributors.

   fontc{{fontc\nCLI font compiler}}
   fontra2fontir[fontra2fontir\nconverts .fontra files to our IR]
   glyphs2fontir[glyphs2fontir\nconverts .glyphs files to our IR]
   ufo2fontir[ufo2fontir\nconverts from a \n.designspace to our IR]
   fontir[fontir\nthe IR for fontc]
   fontbe[fontbe\nthe backend of font compilation\nIR -> binary font]
   fea-rs[fea-rs\nParses and compiles\nAdobe OpenType feature files]
   fontdrasil[fontdrasil\nCommon types and functionality\nshared between all layers of fontc]

    %% Now define the edges.
    %% Made by hand on March 20, 2024, probably not completely correct.
    %% Should be easy to automate if we want to, main thing is to
    %% define the crates of interest.
    fontbe --> fontir
    fontbe --> fea-rs
    fontc --> fontbe
    fontc --> fontir
    fontc --> glyphs2fontir
    fontc --> fontra2fontir
    fontc --> ufo2fontir
    fontra2fontir --> fontir
    glyphs2fontir --> fontir
    ufo2fontir --> fontir

Evaluation & Testing

We use several tools to evaluate the correctness of fontc compared to fontmake:

  • fontc_crater: A tool for compiling thousands of fonts and generating a compatibility report.
  • ttx_diff: A Python tool for comparing the XML representation of fonts (via ttx) produced by fontc and fontmake.
  • otl-normalizer: A tool for normalizing OpenType Layout subtables for easier comparison.

Profiling

For tips on profiling, see docs/performance.md.

Contributing

We have included a few git hooks that you may choose to use to ensure that patches will pass CI; these are in resources/githooks.

To run the pre-push step manually:

$ ./resources/githooks/pre-push

If you would like to have these run automatically when you commit or push changes, you can set this as your git hooksPath:

$ git config core.hooksPath "resources/githooks"

Releasing

See https://github.com/googlefonts/fontations#releasing

To update the Glyphs plugin see https://github.com/googlefonts/fontc-export-plugin.

Release files for fontc 1.0.0rc2

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

Source distribution (sdist)

Source distribution for fontc 1.0.0rc2
File Size Uploaded
fontc-1.0.0rc2.tar.gz 1.8 MB Details

Built distributions (wheels)

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

Total release size: 57.7 MB

Release files / fontc-1.0.0rc2.tar.gz

Download URL fontc-1.0.0rc2.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
de166f33fcce30b4bb78a3bcac5c1b696c7069bb5898ffddc0401a6ea382fa1c
BLAKE2b-256 checksum
How to use checksums
18a3f09aed264633943885d844d97ccfebd5c32be3525c93b1a17b31544594b6
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-win_amd64.whl

Download URL fontc-1.0.0rc2-py3-none-win_amd64.whl
Size 6.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
68cc669519e993b1ecdd8d617e1a3fd258cae0a6c92c82956ade65122ee4f8e6
BLAKE2b-256 checksum
How to use checksums
f35db491f79812fc1a8236132aeabc13df1bcacca1e44510c1c25e34a35531bc
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-win32.whl

Download URL fontc-1.0.0rc2-py3-none-win32.whl
Size 6.0 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
1caebf8de6834f1861c4fd3898889fa80173185e7c224eec61e09aa52950cf3f
BLAKE2b-256 checksum
How to use checksums
e2fafc8a9c86397399cebc86d6d3944f3b73e4c8e0e0aea4e97cf22ea3b88a95
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-musllinux_1_1_x86_64.whl

Download URL fontc-1.0.0rc2-py3-none-musllinux_1_1_x86_64.whl
Size 7.6 MB
Tags Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
35420aa7146de998ec691290148ce14a712b9a1d787ca16bc4c39eaa55194de6
BLAKE2b-256 checksum
How to use checksums
b69d73c2121a2bf2b064f5efcd1d4d7b49284ed125e95aaaf6919c43731da4cb
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-musllinux_1_1_aarch64.whl

Download URL fontc-1.0.0rc2-py3-none-musllinux_1_1_aarch64.whl
Size 7.2 MB
Tags Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ac27893bca686a1f7604bafe5fd9d664d8d5a2f5df150173f5fd0598c953b14f
BLAKE2b-256 checksum
How to use checksums
74f87c9a8a7061317ed1489e901f1f7b7b48895fc8c95baaeceeca09d2c7b321
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fontc-1.0.0rc2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
30adbe756d6169e818587c59221dd8e9a444357327c04d267a8ac3314a9cc8e9
BLAKE2b-256 checksum
How to use checksums
7b4e57fb92b8aa343c3cea930495b403a81d06774f3a2507fe1928a7d3f32824
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fontc-1.0.0rc2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 7.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
36408ccedfa51cebd7257bd5ffddd432ddb7f84fafb17c05ab56c4e1a0842bee
BLAKE2b-256 checksum
How to use checksums
6a3c42a10393aae053c2eef0a0e58931dfa52dbc9dd4bb8ac54de53fef102b46
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 Aug 26, 2026.

Transparency log

Release files / fontc-1.0.0rc2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL fontc-1.0.0rc2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 13.9 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
5d27a71f3196cb67c4b7057de9a1a46598cf9d2fd16eab9a0d2ff4a5be9f9a94
BLAKE2b-256 checksum
How to use checksums
bf38992d99cb473916bc0fa173f75b0a7942fd00cbf74d15759cee6ec03769cf
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 Aug 26, 2026.

Transparency log
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