Skip to content

test(renderer): rasterize standard fonts the same on every platform - #3582

Open
exoego wants to merge 2 commits into
diegomura:masterfrom
exoego:fix/float-split-snapshots
Open

exoego wants to merge 2 commits into
diegomura:masterfrom
exoego:fix/float-split-snapshots

Conversation

@exoego

@exoego exoego commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

CI fails on master and on every PR. Two float snapshot tests are 5.39% different on Linux, just over the 5% threshold.

Cause

The snapshot helper does not pass standardFontDataUrl to pdf.js. So pdf.js draws unembedded Helvetica with the system font, and that font differs between macOS and Linux.

Fix

Pass pdf.js's bundled standard_fonts in renderComponent.js. Now macOS (arm64) and Linux (amd64) render all 96 snapshots the same. The threshold stays at 5%.

I updated the 13 snapshots whose only change is the text glyphs.

Tests

packages/renderer tests pass on macOS and in a node:22 linux/amd64 container.

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

@exoego is attempting to deploy a commit to the diegomura Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7cb852d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@exoego

exoego commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@diegomura Please take a look this first. It fixes CI failure.

Load pdf.js's bundled standard fonts in the snapshot helper. Without them
pdf.js draws unembedded Helvetica with the system font, which differs between
macOS and Linux. Revert the raised threshold and update the snapshots whose
text glyphs changed.
@exoego exoego changed the title test(renderer): fix float split snapshots failing on Linux CI test(renderer): rasterize standard fonts the same on every platform Oct 8, 2026

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.

1 participant