Fix Source Sans font compatibility with variable fonts and TeX Live fallback#624
Open
renaudguerin wants to merge 1 commit into
Open
Fix Source Sans font compatibility with variable fonts and TeX Live fallback#624renaudguerin wants to merge 1 commit into
renaudguerin wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RawFeature={+axis={wght=N}}syntax, fixing builds when only variable fonts are installed (e.g. via Homebrewfont-source-sans-3, or Google Fonts)texlive/texlive:latest), and vanilla TeX Live installsProblem
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:
.ttfwith awghtaxis) — named variants like "Source Sans 3 Light" don't exist as separate fonts, so the build also failsSolution
Uses
\IfFontExistsTF{Source Sans 3}to detect which font is available: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-fontson Arch Linux).Font=*-Light/Font=*-LightItalicsyntax that worked before.Tested with
SourceSans3[wght].ttf) ✅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