Skip to content

Embed installed SVG fonts before capture - #15

Merged
jackspirou merged 6 commits into
mainfrom
codex/resolve-svg-fonts
Oct 8, 2026
Merged

jackspirou merged 6 commits into
mainfrom
codex/resolve-svg-fonts

Conversation

@jackspirou

Copy link
Copy Markdown
Member

Set FontFamily "Menlo" now embeds the installed face for SVG output when Fontconfig is available. The selected bytes load before terminal sizing and capture. Optional FontTools subsets displayed terminal, cursor, and title glyphs, with full-face fallback on failure.

This completes the automatic setup and file-size benefits from #8 and retains its original commits. Explicit flag and environment paths take priority and preserve exact bytes, including video-only capture. Separate title fonts and collection face indices remain distinct. Generic families and fallback stacks retain their current behavior.

The repair escapes font names at the JavaScript, CSS, and XML boundaries. It preserves raster title families, prepares output fonts before successful browser teardown, and tests final even viewport dimensions to prevent an extra column.

Validation:

  • Full native race suite passes 336 cases and 113 top-level tests, with no failed or skipped tests. Earlier checks had two transient startup failures. The report preserves those logs and the passing unchanged-source rerun.
  • Real tape evaluation produces a 5,000-byte font payload versus 231,000 bytes full and retains required Unicode glyphs. Native capture and SVG advances match in automatic, flag, and environment modes.
  • A real installed-font CLI capture discovers Menlo and a separate Helvetica Neue title face. The saved SVG has two WOFF2 subsets with preserved glyphs and advances.
  • Missing or failed tools, invalid metadata and files, browser rejection, and cancellation have regression coverage. Tests also cover collections, explicit priority, video-only font files, and injection.
  • Vet, lint, build, tidy, formatting, diff checks, and 106 tape checks pass. Native rendering evidence covers macOS and Chrome. Linux and Windows native rendering remains UNVERIFIED.

The contributor fork rejected the authenticated LFS lock check during a dry-run push. This replacement uses an owned branch and preserves the contributor’s published history.

Pre-PR autoreview passes with no P0 findings. The exact-content secret scan is clean.

Resolves #8.

xav-ie and others added 6 commits February 26, 2026 12:10
Resolve the configured font family using fc-match, subset it to only
the glyphs used in the SVG frames via pyftsubset (if available), and
embed the result as a base64 @font-face rule. Falls back to embedding
the full font file when pyftsubset is not installed.
@jackspirou
jackspirou merged commit 6415765 into main Oct 8, 2026
8 checks passed
@jackspirou
jackspirou deleted the codex/resolve-svg-fonts branch October 8, 2026 18:14
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