Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Nov 26, 2025

When rendering PDF with fonts that have spaces in names (e.g., "Noto Emoji", "DejaVu Sans"), automatic package installation fails:

finding package for Noto Emoji(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)
ERROR: compilation failed- no matching packages

The fontSearchTerm() function preserves spaces, but font files concatenate names: NotoEmoji-Regular.ttf, DejaVuSans-Bold.ttf.

Fix

Replace spaces with \s* regex pattern for tlmgr search. Pattern now matches both with and without spaces.

Verified with manual testing and unit tests.

Discovered while investigating #13726.

Opened upstream issue for R Markdown: rstudio/tinytex#478

Fixes #13732

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Nov 26, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Fonts with spaces (e.g., "Noto Emoji", "DejaVu Sans") were failing
auto-installation because fontSearchTerm() generated search patterns
that didn't match font files. Font files use concatenated names without
spaces (NotoEmoji-Regular.ttf, DejaVuSans-Bold.ttf).

Replace spaces with \s* regex pattern to match files with or without spaces.

Closes #13726
@cderv cderv merged commit 20d67b9 into main Nov 26, 2025
92 of 93 checks passed
@cderv cderv deleted the fix-font-space-detection branch November 26, 2025 17:33
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.

Font package auto-install fails for fonts with spaces in names

3 participants