Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All changes included in 1.10:
### `pdf`

- ([#13588](https://github.com/quarto-dev/quarto-cli/issues/13588)): Fix Lua error when rendering PDF with `reference-location: margin` and a footnote alongside a figure with `fig-cap`. (author: @mcanouil)
- ([#14553](https://github.com/quarto-dev/quarto-cli/issues/14553), [#14558](https://github.com/quarto-dev/quarto-cli/issues/14558)): Fix PDF render failing instead of auto-installing a missing font referenced by `monofontfallback` (and other `mainfont`/`sansfont`/`monofont` fallbacks).

### `typst`

Expand Down
15 changes: 15 additions & 0 deletions src/command/render/latexmk/parse-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ const formatFontFilter = (match: string, _text: string) => {
return /[.]/.test(base) ? base : fontSearchTerm(base);
};

// luaotfload appends ';-fallback' internally to each fallback-chain entry
// (registered via monofontfallback / luaotfload.add_fallback) to prevent
// recursive fallback resolution. Strip it before building the search term.
// https://github.com/quarto-dev/quarto-cli/issues/14558
const luaotfloadFontFilter = (match: string, text: string) => {
return formatFontFilter(match.replace(/;-fallback$/, ""), text);
};

const estoPdfFilter = (_match: string, _text: string) => {
return "epstopdf";
};
Expand All @@ -291,6 +299,13 @@ const packageMatchers = [
regex: /.*\(fontspec\)\s+The font "([^"]+)" cannot be.*/g,
filter: formatFontFilter,
},
{
// luaotfload fallback-chain font (monofontfallback) missing. fontspec does
// not fire its own error in this path, so this is the only signal.
// https://github.com/quarto-dev/quarto-cli/issues/14558
regex: /.*luaotfload.*reason: Font "([^"]+)" not found.*/g,
filter: luaotfloadFontFilter,
},
{
regex: /.*Package widetext error: Install the ([^ ]+) package.*/g,
filter: (match: string, _text: string) => {
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/latexmk/parse-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () =>
assertFound('! Font \\JY3/mc/m/n/10=file:HaranoAjiMincho-Regular.otf:-kern;jfm=ujis at 9.24713pt not loadable: metric data not found or bad.', "HaranoAjiMincho-Regular.otf");
assertFound('! The font "Noto Emoji" cannot be found.', fontSearchTerm("Noto Emoji"));
assertFound('! Package fontspec Error: The font "DejaVu Sans" cannot be found.', fontSearchTerm("DejaVu Sans"));
// luaotfload fallback-chain font (monofontfallback) - https://github.com/quarto-dev/quarto-cli/issues/14558
// luaotfload appends ;-fallback internally; it must be stripped before building the search term
assertFound('luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "DejaVu Sans Mono;-fallback" not found.', fontSearchTerm("DejaVu Sans Mono"));
assertFound("! LaTeX Error: File `framed.sty' not found.", "framed.sty");
assertFound("! LaTeX Error: File 'framed.sty' not found.", "framed.sty");
assertFound("/usr/local/bin/mktexpk: line 123: mf: command not found", "mf");
Expand Down
Loading