Skip to content

fix(screenshot-change): render design fonts and capture at 2x - #210

Merged
pavelzw merged 1 commit into
mainfrom
mw/font-in-screenshots
Sep 18, 2026
Merged

pavelzw merged 1 commit into
mainfrom
mw/font-in-screenshots

Conversation

@moritzwilksch

@moritzwilksch moritzwilksch commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Screenshots from the skill looked wrong on this machine: the text rendered in DejaVu and the image looked pixelated. Both causes were in the harness.

newPage pinned deviceScaleFactor: 1, so a capture carried half the density of a HiDPI display. It now captures at 2x by default and takes a scale argument. Video stays at 1x, since 2x mp4 mostly wastes bytes.

The client's type stack names ui-monospace and system-ui, both macOS-only. A Linux host resolves them to DejaVu, so a capture no longer looked like the app. newPage and newVideoPage now inject vendored JetBrains Mono and Inter through --mono/--sans before the first paint, then wait on document.fonts.ready. The fonts are devDependencies of the skill, so the app's install and CI stay untouched; without them the harness falls back to the host fonts.

Screenshot

Before is a 1x capture upscaled 2x for comparison; after is the new 2x capture with the vendored fonts.

Before and after: DejaVu text upscaled and chunky, then JetBrains Mono crisp at 2x

A Linux capture host has neither `ui-monospace` nor `system-ui`, so fontconfig substituted DejaVu and captures looked nothing like the app; the harness now fronts vendored JetBrains Mono and Inter in `--mono`/`--sans` before the first paint.

`deviceScaleFactor` was pinned to 1, halving the density of a HiDPI display. `newPage` now captures at 2x by default and exposes `scale`; video stays at 1x since 2x mp4 mostly wastes bytes.
@github-actions github-actions Bot added the fix label Sep 18, 2026
@pavelzw
pavelzw marked this pull request as ready for review September 18, 2026 20:08
@pavelzw
pavelzw merged commit d880eeb into main Sep 18, 2026
15 of 17 checks passed
@pavelzw
pavelzw deleted the mw/font-in-screenshots branch September 18, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants