Skip to content

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

@cderv

Description

@cderv

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglatexLaTeX engines related libraries and technologies

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions