Skip to content

Fix Source Sans font compatibility with variable fonts and TeX Live fallback#624

Open
renaudguerin wants to merge 1 commit into
posquit0:masterfrom
renaudguerin:fix/variable-font-compat
Open

Fix Source Sans font compatibility with variable fonts and TeX Live fallback#624
renaudguerin wants to merge 1 commit into
posquit0:masterfrom
renaudguerin:fix/variable-font-compat

Conversation

@renaudguerin
Copy link
Copy Markdown

Summary

  • Adds variable font support for Source Sans 3 using fontspec's RawFeature={+axis={wght=N}} syntax, fixing builds when only variable fonts are installed (e.g. via Homebrew font-source-sans-3, or Google Fonts)
  • Falls back to "Source Sans Pro" (bundled with TeX Live) when "Source Sans 3" is not installed, restoring out-of-the-box compatibility with Overleaf, Docker (texlive/texlive:latest), and vanilla TeX Live installs

Problem

Since commits 852b042 and f05fc68, the template requires "Source Sans 3" as separate static font files per weight ("Source Sans 3 Light", "Source Sans 3 Bold", etc.). However:

  1. TeX Live bundles the font under its old name "Source Sans Pro" — so Overleaf, Docker, and fresh installs fail
  2. Homebrew and Google Fonts distribute Source Sans 3 as a variable font (single .ttf with a wght axis) — named variants like "Source Sans 3 Light" don't exist as separate fonts, so the build also fails

Solution

Uses \IfFontExistsTF{Source Sans 3} to detect which font is available:

  • If "Source Sans 3" is found: uses RawFeature={+axis={wght=N}} to select weights from the variable font. This syntax is harmlessly ignored by static fonts, so it also works with static "Source Sans 3" installs (e.g. adobe-source-sans-fonts on Arch Linux).
  • If not found: falls back to "Source Sans Pro" with the original Font=*-Light / Font=*-LightItalic syntax that worked before.

Tested with

  • macOS + MacTeX 2026 + Homebrew variable font (only SourceSans3[wght].ttf) ✅
  • macOS + MacTeX 2026 + Adobe static fonts (individual weight files) ✅
  • macOS + MacTeX 2026 + both variable and static installed ✅
  • macOS + TeX Live "Source Sans Pro" fallback (no Source Sans 3 installed) ✅
  • All three examples (resume, cv, coverletter) build with no font warnings ✅

Note

Roboto is left unchanged — it is bundled as static OTFs in TeX Live and works everywhere with the existing configuration.

Fixes #606, fixes #610

The current font configuration expects separate static font files for
each weight (e.g. "Source Sans 3 Light", "Source Sans 3 Bold"), which
are not found when only variable fonts are installed. Modern package
managers (Homebrew, Google Fonts) ship Source Sans 3 exclusively as
variable fonts, causing build failures on macOS and other platforms.

Use fontspec RawFeature axis syntax to select weights from variable
fonts, and fall back to "Source Sans Pro" (bundled with TeX Live) when
"Source Sans 3" is not installed at all. This supports:
- Variable fonts from Homebrew/Google Fonts
- Static "Source Sans 3" from Adobe or Linux distro packages
- Static "Source Sans Pro" from TeX Live (Overleaf, Docker, etc.)

Fixes posquit0#606, fixes posquit0#610

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the size/S Small size issue or PR. label Mar 20, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

👋 Welcome! Looks like this is your first pull request.

Hey, thanks for your contribution! Please give us a bit of time to review it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small size issue or PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The font "Source Sans 3" cannot be found Font "SourceSans3" not found

1 participant