head table bounding box is not recalculated for variable font instances

Open
#40 4 comments 0 reactions 0 assignees View on GitHub

@khaledhosny is already working on this.

Since Oct 29, 2026.

  • #41 by @khaledhosny — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start by reading subset_with_variations() and the code that writes the OpenType head table; the issue does not name files or tests. Check how the default instance's bounds are copied and whether existing variation tests cover the table. Done means the instantiated font's xMin, yMin, xMax, and yMax include its glyph bounds, preventing macOS rasterizer cropping.

Written by the indexing model from the issue text.

Description

Using subset_with_variations() to instance of a variable font, it does not update the head table bounds (xMin, yMin, xMax and yMax are copied unchanged). Some glyphs in the instance might be bigger than the bounds of the default instance.

The macOS rasterizer crops glyphs outside of the head bounds. This can be seen when opening PDFs created with Krilla in macOS Preview (I had the same issue in PDFs created with Illustrator previously).

Dominant language
Rust
Stars
61
Forks
16
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from typst/subsetter

All issues in typst/subsetter

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.