Skip to content

builder: apply a font's own TrueType hinting from a hinting file - #1248

Open
felipesanches wants to merge 2 commits into
googlefonts:mainfrom
felipesanches:apply-hinting
Open

felipesanches wants to merge 2 commits into
googlefonts:mainfrom
felipesanches:apply-hinting

Conversation

@felipesanches

@felipesanches felipesanches commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

A source format cannot carry a compiled font's TrueType hinting: glyph
programs address points by index, and hdmx, LTSH and VDMX have no source
form. `hintingFiles` maps a static TTF to a text file holding its fpgm, prep,
cvt, gasp, maxp limits, device metrics, glyph programs (with ufo2ft's point
hashes) and component flags; the new applyHinting step applies it after
compiling, in place of autohinting, and refuses glyphs whose points differ.
gftools-extract-hinting writes the file from a hinted font.

Assisted by an AI agent (Claude Opus 5.5)
… head flags 2 and 4

Assisted by an AI agent (Claude Opus 5.5)
@simoncozens

Copy link
Copy Markdown
Contributor

This is all very clever but wouldn't an easier and more general-purpose approach just be to have an operation which calls ttx -m to merge in a TTX dump? That could also handle MATH tables, etc.

@felipesanches

Copy link
Copy Markdown
Member Author

wouldn't an easier and more general-purpose approach just be to have an operation which calls ttx -m to merge in a TTX dump?

That works for whole tables (fpgm, prep, cvt, gasp, MATH), but ttx -m replaces whole tables, and the glyph programs live inside glyf: merging glyf would replace every outline with the release's, so the font would no longer be built from its source.

This PR puts each glyph's program on the built glyph, refusing it when the points differ, after restoring the points the toolchain changes (start points, the midpoint on-curves fontc drops, F2Dot14 transforms, stale boxes).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants