Skip to main content

Temporary font installation on macOS for type designers

Project description

fonttry

Temporarily install fonts on macOS from any source format — without touching Font Book.

fonttry compiles and installs fonts into the current macOS session scope via CoreText. As soon as you hit Ctrl+C or close the terminal, the fonts are unregistered automatically. Your original files are never modified.


Features

  • One command to compile + install + uninstall
  • Supports .otf, .ttf, .ufo, .designspace, .glyphs, .glyphx, .fontra
  • Compiles via fontmake (UFO, Designspace, Glyphs) or the Fontra Python backend (Fontra)
  • Choose output format with -o: ttf (default), otf (CFF2 for variable), or static with --instance
  • Pre-flight checks before compiling multi-master sources:
    • detects missing glyphs per master
    • checks contour count, point structure and component compatibility
    • removes incompatible glyphs automatically so compilation doesn't fail
    • synchronises kerning and public.glyphOrder across masters
  • Works in session scope: fonts are visible in any application on your system
  • Cleans up stale workspaces from previous runs automatically
  • Cleans up on Ctrl+C, SIGTERM or SIGHUP

Requirements

  • macOS (uses CoreText — Linux/Windows not supported)
  • Python 3.10+
  • Xcode Command Line Tools (for compiling the CoreText helper on first run):
    xcode-select --install
    

Installation

From PyPI (recommended)

pip install fonttry

This installs fontmake and all required dependencies. fonttry supports .otf, .ttf, .ufo, .designspace and .glyphs sources out of the box.

.fontra support (optional)

If you work with .fontra projects, one additional package is required. It has no PyPI release yet and must be installed directly from GitHub:

pip install git+https://github.com/fontra/fontra-compile

You only need this if you intend to use fonttry with .fontra files.

From source

git clone https://github.com/typium/fonttry
cd fonttry
pip install -r requirements.txt   # includes fontra-compile from GitHub
pip install -e .

Usage

# Binary fonts — install directly
fonttry MyFont.otf
fonttry MyFont.ttf

# UFO — compiles to TTF, then installs
fonttry MyFont.ufo

# Designspace — compiles to variable TTF by default
fonttry MyFamily.designspace

# Designspace — compile as variable CFF2 (OTF)
fonttry MyFamily.designspace -o otf

# Designspace — compile a specific named instance
fonttry MyFamily.designspace --instance "Regular"
fonttry MyFamily.designspace --instance "Regular" -o otf

# Glyphs file
fonttry MyFont.glyphs
fonttry MyFont.glyphs --instance "Bold"

# Fontra project (requires fontra-compile, see Installation)
fonttry MyFont.fontra

Output format (-o)

Flag Variable source Static (--instance or UFO)
(none) variable TTF TTF
-o ttf variable TTF TTF
-o otf variable CFF2 OTF
-o variable-ttf variable TTF
-o variable-otf variable CFF2

Verbose mode

fonttry MyFamily.designspace --verbose

Shows all missing or incompatible glyphs without truncation.


Terminal output

📋  Preparing workspace…
  → Workspace : /path/to/.fonttry_abc123

⚙  Compiling MyFamily.designspace…
  → fontmake --output-dir … -m MyFamily.designspace -o variable
  ✓  1 font(s) compiled

⬆  Temporary installation (Session scope)…
  ✓  MyFamily[wght].ttf

✓  1 active font(s) — visible in any application on your system.
   🔤  MyFamily Regular

   Ctrl+C to uninstall and quit.

Press Ctrl+C to uninstall and exit.


How it works

  1. Workspace — a hidden temp folder is created next to your source. Your original files are never touched. Stale workspaces from previous failed runs are cleaned up automatically.
  2. Pre-flight (multi-master sources) — sources are checked for interpolation compatibility. Incompatible glyphs are removed from the workspace copy so compilation doesn't fail.
  3. Compilationfontmake is called for UFO, Designspace and Glyphs sources. Fontra sources are first exported to Designspace via the Fontra Python backend, then compiled with fontmake.
  4. Staging — compiled fonts are copied to ~/Library/Application Support/fonttry/.
  5. Registration — a small CoreText helper registers the fonts at session scope. Fonts are visible to all apps immediately, without admin rights, and disappear when the session ends.
  6. Cleanup — on exit, the helper unregisters the fonts and the workspace is deleted.

The CoreText helper (fonthelper) is compiled from Objective-C on first run using clang. It is cached in the staging directory and reused on subsequent runs.


Project structure

fonttry/
├── src/
│   └── fonttry/
│       ├── __init__.py       # version
│       ├── core.py           # all logic + CLI entry point
│       └── checks.py         # --lint quality checks
├── .github/
│   └── workflows/
│       └── publish.yml       # publishes to PyPI on release
├── pyproject.toml            # build config + dependencies
├── requirements.txt          # includes fontra-compile (no PyPI release)
├── CHANGELOG.md
├── CONTRIBUTING.md
├── AUTHORS.txt
└── LICENSE

Publishing a new version (maintainers)

  1. Bump version in pyproject.toml and src/fonttry/__init__.py.
  2. Update CHANGELOG.md.
  3. Commit, tag and push:
    git tag v0.2.0
    git push origin v0.2.0
    
  4. Create a GitHub Release from the tag → the publish.yml workflow uploads to PyPI automatically via trusted publishing (no API key required).

Contributing

See CONTRIBUTING.md.


License

GPL-3.0 — see LICENSE.

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

fonttry-0.1.1.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fonttry-0.1.1-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file fonttry-0.1.1.tar.gz.

File metadata

  • Download URL: fonttry-0.1.1.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fonttry-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2885317539af60009bd54d2f49bd23cf5d49251a684aac3bb72a1fa7d52ded5a
MD5 a984c9104cb245f99df163ed4b65876f
BLAKE2b-256 0e2721443afff2b9018a7d1e9971fec50dcc504060f4b6974fa54a5e32827074

See more details on using hashes here.

Provenance

The following attestation bundles were made for fonttry-0.1.1.tar.gz:

Publisher: publish.yml on Typium-xyz/fonttry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fonttry-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fonttry-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fonttry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ea46f5b49842c5d2415e73df963dd6519b0ad020c3ff30de87647e15705056a
MD5 c6d5f9dd1b026d4d39e93ef94f80b1c3
BLAKE2b-256 6eee27361b832fd8369b0a6e2c0e132e3e6adfd07b5a17e386881339ba903a39

See more details on using hashes here.

Provenance

The following attestation bundles were made for fonttry-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Typium-xyz/fonttry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page