Skip to content

feat(fonts): add Playfair Display, Noto Sans JP, Roboto, and 4 more to deterministic font database#196

Merged
vanceingalls merged 4 commits into
mainfrom
feat/fonts-expand-deterministic-database
Apr 2, 2026
Merged

feat(fonts): add Playfair Display, Noto Sans JP, Roboto, and 4 more to deterministic font database#196
vanceingalls merged 4 commits into
mainfrom
feat/fonts-expand-deterministic-database

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Expands the deterministic font database from 11 to 18 font families (25 → 42 font faces, 718KB woff2). E2E testing found that Playfair Display, Noto Sans JP, Roboto, and others fell through to dynamic Google Fonts loading, which breaks in Docker/offline renders.

New fonts:

Font Weights Use case
Playfair Display 400, 700, 900 Serif/editorial
Noto Sans JP 400, 700 Japanese text
Roboto 400, 700, 900 Android/Material
Open Sans 400, 700 General body text
Lato 400, 700, 900 Clean professional
Poppins 400, 700, 900 Modern headings
Source Code Pro 400, 700 Code blocks

New aliases: Segoe UI → Roboto, Noto Sans Japanese → Noto Sans JP

Part 4 of 5 in a stacked PR series fixing E2E test findings.

Test plan

  • npx hyperframes render with Playfair Display font — no "Unresolved font families" warning
  • npx hyperframes render --docker with Noto Sans JP — Japanese characters render correctly
  • Existing fonts still resolve correctly

Comment on lines +76 to 104
"playfair-display": {
packageName: "@fontsource/playfair-display",
faces: [{ weight: "400" }, { weight: "700" }, { weight: "900" }],
},
"source-code-pro": {
packageName: "@fontsource/source-code-pro",
faces: [{ weight: "400" }, { weight: "700" }],
},
"noto-sans-jp": {
packageName: "@fontsource/noto-sans-jp",
faces: [{ weight: "400" }, { weight: "700" }],
},
roboto: {
packageName: "@fontsource/roboto",
faces: [{ weight: "400" }, { weight: "700" }, { weight: "900" }],
},
"open-sans": {
packageName: "@fontsource/open-sans",
faces: [{ weight: "400" }, { weight: "700" }],
},
lato: {
packageName: "@fontsource/lato",
faces: [{ weight: "400" }, { weight: "700" }, { weight: "900" }],
},
poppins: {
packageName: "@fontsource/poppins",
faces: [{ weight: "400" }, { weight: "700" }, { weight: "900" }],
},
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we may need a better way to handle this long term

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I think users should download always their fonts to avoid hardcoding fonts like this

@miguel-heygen miguel-heygen force-pushed the fix/render-suppress-font-404-noise branch from 371a6b7 to 5a3e099 Compare April 2, 2026 16:43
@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from 6d9cdae to ab8c4ee Compare April 2, 2026 16:43
@miguel-heygen miguel-heygen force-pushed the fix/render-suppress-font-404-noise branch from 5a3e099 to f4a4d76 Compare April 2, 2026 16:46
@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch 2 times, most recently from ce63fc7 to c3b24b6 Compare April 2, 2026 16:47

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review feedback — approved

Clean and well-structured. Font selection is solid — Roboto, Open Sans, Lato, Poppins cover the most common web fonts. Noto Sans JP for CJK is excellent. The Segoe UI → Roboto alias is smart for headless Linux/Docker.

Minor: worth noting the size impact of Noto Sans JP faces on CLI distribution if it's significant.

@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from c3b24b6 to b95806e Compare April 2, 2026 17:03
@miguel-heygen miguel-heygen force-pushed the fix/render-suppress-font-404-noise branch from 040c458 to f81757e Compare April 2, 2026 17:03
@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Agreed. The CANONICAL_FONTS map is already getting long, and adding CJK fonts (Noto Sans SC, KR, Arabic, etc.) will make it bigger. A longer-term approach could be:

  • A separate fonts.json registry that maps family names to fontsource package names + weights
  • An npx hyperframes fonts add <family> command that downloads and embeds on demand
  • Runtime font resolution that falls back to Google Fonts API when a font isn't in the embedded database

Happy to scope that as a follow-up issue.

@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from f81757e to 36582e6 Compare April 2, 2026 21:10
@vanceingalls vanceingalls force-pushed the feat/fonts-expand-deterministic-database branch from b95806e to 5ff4a8d Compare April 2, 2026 21:11
miguel-heygen and others added 2 commits April 2, 2026 21:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ssing

Address review feedback: instead of silently dropping "Failed to load
resource" errors (which could hide real asset failures), keep them in
browserConsoleBuffer for diagnostics but don't print to stdout. Real
asset 404s are still caught by the file server's own logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from 36582e6 to e76e312 Compare April 2, 2026 21:13
Address review: filter was too broad and could suppress real asset
failures. Now only suppresses 404s matching fonts.googleapis,
fonts.gstatic, or .woff2 file extensions. Missing images, scripts,
and videos will still surface as [Browser:ERROR] in render output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the fix/render-suppress-font-404-noise branch from e76e312 to dc47aa7 Compare April 2, 2026 21:13
…o deterministic font database

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the feat/fonts-expand-deterministic-database branch from 5ff4a8d to e365e01 Compare April 2, 2026 21:13
@graphite-app graphite-app Bot changed the base branch from fix/render-suppress-font-404-noise to main April 2, 2026 21:31
@vanceingalls vanceingalls merged commit 7294803 into main Apr 2, 2026
22 checks passed
miguel-heygen added a commit that referenced this pull request Apr 3, 2026
…o deterministic font database (#196)

* fix(engine): suppress font-loading 404 noise in render console output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(engine): downgrade resource 404s to buffer-only instead of suppressing

Address review feedback: instead of silently dropping "Failed to load
resource" errors (which could hide real asset failures), keep them in
browserConsoleBuffer for diagnostics but don't print to stdout. Real
asset 404s are still caught by the file server's own logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(engine): narrow 404 filter to font CDN domains and woff2 files only

Address review: filter was too broad and could suppress real asset
failures. Now only suppresses 404s matching fonts.googleapis,
fonts.gstatic, or .woff2 file extensions. Missing images, scripts,
and videos will still surface as [Browser:ERROR] in render output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(fonts): add Playfair Display, Noto Sans JP, Roboto, and 4 more to deterministic font database

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen deleted the feat/fonts-expand-deterministic-database branch April 6, 2026 23:24
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.

3 participants