Skip to content

perf/legal: self-host Inter and JetBrains Mono fonts#66

Merged
mwiesen merged 1 commit intomasterfrom
feat/self-host-fonts
Apr 30, 2026
Merged

perf/legal: self-host Inter and JetBrains Mono fonts#66
mwiesen merged 1 commit intomasterfrom
feat/self-host-fonts

Conversation

@mwiesen
Copy link
Copy Markdown
Member

@mwiesen mwiesen commented Apr 30, 2026

Summary

  • Removes runtime requests to fonts.googleapis.com / fonts.gstatic.com
  • Downloads latin-subset woff2 files for Inter and JetBrains Mono into src/assets/fonts/
  • Adds @font-face declarations in tailwind.css; adds a copyFonts Gulp task
  • Removes the three Google Fonts <link> tags from the layout

Motivation

Loading Google Fonts dynamically transmits visitor IP addresses to Google servers in the US. Under German law this violates GDPR — the LG München I ruled in January 2022 that this constitutes an unlawful data transfer without consent and awarded damages to the plaintiff.

Test plan

  • Run npm run build — should complete without errors
  • Confirm dist/assets/fonts/ contains both woff2 files
  • Open the site locally (npm run dev) and verify Inter and JetBrains Mono render correctly
  • Check browser DevTools Network tab: zero requests to googleapis.com or gstatic.com

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes external Google Fonts requests by self-hosting Inter and JetBrains Mono, ensuring the site no longer contacts fonts.googleapis.com / fonts.gstatic.com at runtime (GDPR-related motivation).

Changes:

  • Removed Google Fonts <link> tags from the modern layout and switched to self-hosted fonts.
  • Added @font-face declarations to Tailwind CSS and introduced a Gulp task to copy font assets into dist/.
  • Updated profile/spxp-posts content/timestamps (appears unrelated to the font/legal goal of this PR).
Show a summary per file
File Description
src/layouts/modern.html Removes Google Fonts includes; relies on Tailwind CSS for font declarations.
src/css/tailwind.css Adds @font-face rules pointing to local WOFF2 assets.
src/assets/fonts/inter-latin.woff2 Adds self-hosted Inter Latin WOFF2 font file.
src/assets/fonts/jetbrains-mono-latin.woff2 Adds self-hosted JetBrains Mono Latin WOFF2 font file.
gulpfile.js Adds copyFonts task and wires it into dev and build.
profile/spxp-posts Updates timestamps and adds/changes post entries (not described in PR).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/6 changed files
  • Comments generated: 2

Comment thread gulpfile.js
Comment thread profile/spxp-posts Outdated
Removes runtime requests to fonts.googleapis.com and fonts.gstatic.com.
Loading Google Fonts dynamically transmits visitor IP addresses to Google
servers, which violates GDPR under German law (LG München I, Jan 2022).

- Download latin-subset woff2 files for Inter (variable, 100–900) and
  JetBrains Mono (variable, 100–800) into src/assets/fonts/
- Declare @font-face in tailwind.css so fonts are served from /assets/fonts/
- Add copyFonts gulp task; include in dev and build pipelines
- Remove three Google Fonts <link> tags from modern.html layout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mwiesen mwiesen force-pushed the feat/self-host-fonts branch from a71985a to 60a1f41 Compare April 30, 2026 10:21
@mwiesen
Copy link
Copy Markdown
Member Author

mwiesen commented Apr 30, 2026

Re Copilot's suggestion about watching the fonts directory: font files are committed binary assets that don't change during development, so there's no practical benefit to watching them. In the unlikely event a font file is ever swapped out, restarting gulp dev is the right approach. Dismissing this suggestion.

@mwiesen mwiesen merged commit 7a00db0 into master Apr 30, 2026
1 check passed
@mwiesen mwiesen deleted the feat/self-host-fonts branch May 5, 2026 06:13
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