The LaTeX preamble inst/quarto/latex/civilytics.tex requires a Source Serif 4 SemiBold system font that the package never installs and that a standard Source Serif 4 install doesn't include, so xelatex/lualatex renders fail.
Package fontspec Error: The font "Source Serif 4 SemiBold" cannot be found.
Root cause
The package installs no system fonts for the PDF/fontspec path. R/fonts.R only registers fonts via sysfonts/showtext (for ggplot2 raster output), and the SCSS pulls webfonts — neither puts a SemiBold face on the system where fontspec looks.
A standard Source Serif 4 install ships Regular / Bold / Italic / BoldItalic — there is no SemiBold weight by default.
Even when a SemiBold weight is present, naming is inconsistent: Adobe's static face is Source Serif 4 Semibold (lowercase "b"), while Google names it SemiBold — so BoldFont = * SemiBold still won't match Adobe's file.
Suggested fix
Don't require a weight that isn't guaranteed. Use the always-present Bold weight — drop the explicit BoldFont/BoldItalicFont overrides so fontspec auto-selects the family's native Bold/BoldItalic:
(If the lighter SemiBold look is desired, ship the SemiBold face with the package or via a font-install helper and select it by weight — but the template shouldn't hard-require a face the setup doesn't provide.)
Found while rendering a branded PDF (COG finance API spec).
## Summary
The LaTeX preamble `inst/quarto/latex/civilytics.tex` requires a **Source Serif 4 SemiBold** system font that the package never installs and that a standard Source Serif 4 install doesn't include, so xelatex/lualatex renders fail.
## The offending lines
```latex
\setmainfont{Source Serif 4}[
UprightFont = *,
ItalicFont = * Italic,
BoldFont = * SemiBold,
BoldItalicFont = * SemiBold Italic,
Ligatures = TeX,
]
```
## Error
```
Package fontspec Error: The font "Source Serif 4 SemiBold" cannot be found.
```
## Root cause
- The package installs **no system fonts** for the PDF/fontspec path. `R/fonts.R` only registers fonts via `sysfonts`/`showtext` (for ggplot2 raster output), and the SCSS pulls webfonts — neither puts a SemiBold face on the system where `fontspec` looks.
- A standard Source Serif 4 install ships **Regular / Bold / Italic / BoldItalic** — there is no SemiBold weight by default.
- Even when a SemiBold weight is present, naming is inconsistent: Adobe's static face is `Source Serif 4 Semibold` (lowercase "b"), while Google names it `SemiBold` — so `BoldFont = * SemiBold` still won't match Adobe's file.
## Suggested fix
Don't require a weight that isn't guaranteed. Use the always-present Bold weight — drop the explicit `BoldFont`/`BoldItalicFont` overrides so `fontspec` auto-selects the family's native Bold/BoldItalic:
```latex
\setmainfont{Source Serif 4}[
UprightFont = *,
ItalicFont = * Italic,
Ligatures = TeX,
]
```
(If the lighter SemiBold look is desired, ship the SemiBold face with the package or via a font-install helper and select it by weight — but the template shouldn't hard-require a face the setup doesn't provide.)
Found while rendering a branded PDF (COG finance API spec).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The LaTeX preamble
inst/quarto/latex/civilytics.texrequires a Source Serif 4 SemiBold system font that the package never installs and that a standard Source Serif 4 install doesn't include, so xelatex/lualatex renders fail.The offending lines
Error
Root cause
R/fonts.Ronly registers fonts viasysfonts/showtext(for ggplot2 raster output), and the SCSS pulls webfonts — neither puts a SemiBold face on the system wherefontspeclooks.Source Serif 4 Semibold(lowercase "b"), while Google names itSemiBold— soBoldFont = * SemiBoldstill won't match Adobe's file.Suggested fix
Don't require a weight that isn't guaranteed. Use the always-present Bold weight — drop the explicit
BoldFont/BoldItalicFontoverrides sofontspecauto-selects the family's native Bold/BoldItalic:(If the lighter SemiBold look is desired, ship the SemiBold face with the package or via a font-install helper and select it by weight — but the template shouldn't hard-require a face the setup doesn't provide.)
Found while rendering a branded PDF (COG finance API spec).
Fixed in PR #15 (merged to master).