Skip to content

feat(slides): bundle Inter TTFs so figures match the deck font (#109)#146

Merged
YongboYu merged 1 commit into
mainfrom
fix/109-bundle-inter
Jun 9, 2026
Merged

feat(slides): bundle Inter TTFs so figures match the deck font (#109)#146
YongboYu merged 1 commit into
mainfrom
fix/109-bundle-inter

Conversation

@YongboYu

@YongboYu YongboYu commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Closes #109.

Problem

make_figures.py set font.family = Inter but only checked matplotlib's system
font cache. Inter isn't installed system-wide on the dev machine / CI, so figures
silently fell back to DejaVu Sans — non-deterministic across machines and
off-font vs the Inter deck.

Fix

  • Bundle Inter static TTFs (Regular/Medium/SemiBold/Bold, SIL OFL 1.1 — redistribution OK)
    under slides/scripts/fonts/, plus OFL.txt. All four report family name Inter.
  • Register them with fontManager.addfont(...) before the deck-font resolution /
    rcParams block, so font.family = Inter resolves from the repo regardless of system
    install.
  • Keep DejaVu Sans as the glyph-safe fallback (covers the / U+2192 arrow in DF edge names).
  • Regenerated all figures.

Verification

  • findfont('Inter') resolves to the bundled slides/scripts/fonts/Inter-Regular.ttf.
  • uv run python slides/scripts/make_figures.py — no Inter not found fallback warning,
    no missing-glyph warnings.
  • confirmed rendering (no tofu) in the drift figures (e.g. bpi2017-drift-with-tsfm.png).

Figures rendered in DejaVu Sans whenever Inter was not installed
system-wide, making output non-deterministic across machines/CI and
off-font vs the Inter deck.

Bundle the Inter static TTFs (Regular/Medium/SemiBold/Bold, SIL OFL)
under slides/scripts/fonts/ and register them with matplotlib via
fontManager.addfont() before resolving the deck font. font.family=Inter
now resolves from the repo regardless of system install; DejaVu Sans
stays as the glyph-safe fallback (covers the U+2192 arrow in DF edge
names). Regenerated all figures: no fallback or missing-glyph warnings.
@YongboYu YongboYu merged commit 3a68189 into main Jun 9, 2026
5 checks passed
@YongboYu YongboYu deleted the fix/109-bundle-inter branch June 9, 2026 11:32
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.

Bundle Inter TTFs so figures match the deck font on any machine

1 participant