When rendering PDF documents with fonts that have spaces in their names (e.g., "Noto Emoji", "DejaVu Sans"), automatic package installation fails.
Error
luaotfload | db : Reload initiated; reason: Font "Noto Emoji" not found
updating tlmgr
updating existing packages
finding package for Noto Emoji(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)
ERROR: compilation failed- no matching packages
Package fontspec Error: The font "Noto Emoji" cannot be found
Root Cause
The fontSearchTerm() function preserves spaces from the font name reported by LaTeX, but font files never have spaces in their names:
- Actual:
NotoEmoji-Regular.ttf, DejaVuSans-Bold.ttf
- Searched:
Noto Emoji-Regular.ttf, DejaVu Sans-Bold.ttf
Minimal Example
---
title: "Test"
format:
pdf:
pdf-engine: lualatex
mainfont: "Noto Emoji"
---
Test document.
Discovered while investigating #13726.
When rendering PDF documents with fonts that have spaces in their names (e.g., "Noto Emoji", "DejaVu Sans"), automatic package installation fails.
Error
Root Cause
The
fontSearchTerm()function preserves spaces from the font name reported by LaTeX, but font files never have spaces in their names:NotoEmoji-Regular.ttf,DejaVuSans-Bold.ttfNoto Emoji-Regular.ttf,DejaVu Sans-Bold.ttfMinimal Example
Discovered while investigating #13726.