Skip to content

Commit 08b05eb

Browse files
committed
fix(ci): copy Libertinus OTFs into fontconfig's scan path
The preflight check from the previous commit caught it before the PDF build started: MISSING font: Libertinus Serif MISSING font: Libertinus Sans ERROR: required font not visible to fontconfig. Root cause: texlive-fonts-extra installs LibertinusSerif-Regular.otf and siblings into /usr/share/texlive/texmf-dist/fonts/opentype/ public/libertinus-fonts/, but on ubuntu-latest the texlive package does NOT install a fontconfig snippet that exposes TeX Live's font tree to fc-list. So `fc-cache -f` alone won't make Libertinus visible by family name even though the files are on disk. Fix: after apt-installing texlive-fonts-extra, locate the Libertinus OTF files via kpsewhich (version-agnostic) and copy them into /usr/local/share/fonts/libertinus/, which fontconfig always scans. Then `fc-cache -f` makes fontspec resolve 'Libertinus Serif' / 'Libertinus Sans' / 'Libertinus Mono' / 'Libertinus Math' by family name. The preflight verification from the previous commit stays — it now serves as a post-condition check that the copy actually worked.
1 parent 23c220b commit 08b05eb

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,23 @@ jobs:
8484
texlive-pictures \
8585
lmodern \
8686
fonts-dejavu
87-
# texlive-fonts-extra ships Libertinus Serif / Sans under
88-
# /usr/share/texlive/texmf-dist/fonts/opentype/public/libertinus-fonts/.
89-
# On Ubuntu the texlive package installs a fontconfig snippet that
90-
# exposes this path; refresh the fontconfig cache so xelatex's
91-
# fontspec can locate Libertinus by family name.
87+
# texlive-fonts-extra ships Libertinus Serif / Sans / Mono OTF
88+
# files inside TeX Live's font tree, but Ubuntu's texlive package
89+
# does NOT register that tree with fontconfig — so xelatex's
90+
# fontspec can't find them by family name. Copy the OTFs into
91+
# /usr/local/share/fonts/ (a path fontconfig always scans) and
92+
# refresh the cache so 'Libertinus Serif' resolves at PDF build
93+
# time. kpsewhich locates the file regardless of TeX Live
94+
# version-specific path layout.
95+
LIBERTINUS_OTF=$(kpsewhich -format=opentype\ fonts LibertinusSerif-Regular.otf || true)
96+
if [ -n "$LIBERTINUS_OTF" ] && [ -f "$LIBERTINUS_OTF" ]; then
97+
LIBERTINUS_DIR=$(dirname "$LIBERTINUS_OTF")
98+
sudo mkdir -p /usr/local/share/fonts/libertinus
99+
sudo cp "$LIBERTINUS_DIR"/*.otf /usr/local/share/fonts/libertinus/
100+
echo "Copied Libertinus OTF files from $LIBERTINUS_DIR"
101+
else
102+
echo "WARNING: LibertinusSerif-Regular.otf not found via kpsewhich"
103+
fi
92104
sudo fc-cache -f >/dev/null 2>&1 || true
93105
94106
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)