Repository navigation
fix(deps): fontkit comes from npm again, and a variable face in a WOFF or a WOFF2 is read as the sfnt inside it - #485
Merged
Conversation
…F or a WOFF2 is read as the sfnt inside it
sidorares
pushed a commit
that referenced
this pull request
Sep 30, 2026
🤖 I have created a release *beep* *boop* --- ## [8.17.3](v8.17.2...v8.17.3) (2026-09-30) ### Bug Fixes * **deps:** fontkit comes from npm again, and a variable face in a WOFF or a WOFF2 is read as the sfnt inside it ([#485](#485)) ([b5d5320](b5d5320)) * **svg:** an element that is display: none is not drawn, nor anything in it ([#483](#483)) ([3ece30b](3ece30b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
8.17.2 never reached npm, and nothing merged since 8.17.1 is published. #479 named fontkit by the URL of a fork's release tarball, and npm 12 fetches no URL or git dependency unless told to:
allow-remoteandallow-gitdefault tonone. The publish job upgrades npm and failed innpm ciwithEALLOWREMOTE. The test jobs install with the npm their Node ships, so CI was green. An application on npm 12 could not have installed that version either, which I reproduced with npm 12.1.0 against a packed master.That was my recommendation in #479 and it was wrong: I tried the tarball with npm 11 and Bun, not with the npm the publish job uses.
What this does
fontkitis^2.0.4from npm again, and the lockfile is 8.17.1's for it.What the fork was for is done here instead. fontkit cuts an instance of a variable font by reading the file again as a plain sfnt, which a WOFF or a WOFF2 is not. So a variable face that arrives in a container is handed to fontkit as the sfnt inside it, built by the new
lib/text/sfnt.js: a WOFF's tables as fontkit inflates them, a WOFF2's as it decompresses them, withglyfandlocawritten back from the transformed streams. It is done once, when the face is opened, 10 ms for Geist's 70 KB WOFF2. A static face stays in its container, and a container that cannot be taken apart stays too and refuses atvariation, as before #479.CI has a
publishablejob that does what the publish job does up to the upload, with the newest npm, and then installs the packed tarball into an empty project.The
locaguard from #479 stays: it is about static WOFF2 faces and does not depend on which fontkit is installed.Verification
.woffand the.woff2fixture equals the sfnt's, at three weights.test/sfnt.test.js: the sfnt made of a WOFF is the original, table for table. The one made of a WOFF2 has every table butglyf,locaandheadbyte for byte, and every glyph reads the same. The two faces used have composite, hinted and empty glyphs between them, and a test says so.glyf.<Html>with thislib/and fontkit 2.0.4: all 728 characters of Geist's variable WOFF2 at eight weights, each matched to an instance of the rebuilt face.npm ci,npm publish --dry-run, and an install of the packed tarball into an empty project all pass.npm test: 1449 pass, 10 skipped, none fail.After this
8.17.2 cannot be published from its tag, whose commit has the URL. Merging this and then the release PR, #484, publishes 8.17.3 with everything since 8.17.1.