feat(monospace): wire PDF export to use bundled monospace font

Replaces -V monofont=Consolas with a generated xelatex/lualatex header
that fontspec-loads the bundled JetBrains Mono or Fira Code TTF. Adds
a cached settings reader with proper invalidation on store.set, and
reorders fallback engines to prefer lualatex (fontspec-capable) before
pdflatex.
This commit is contained in:
2026-08-23 19:31:33 +05:30
parent cdc318ebc7
commit 269d4ac028
4 changed files with 52 additions and 7 deletions
+3 -1
View File
@@ -25,7 +25,9 @@ function buildFontFaceBlock(familyKey) {
const data = fs.readFileSync(fontPath);
const dataUri = `data:font/woff2;base64,${data.toString('base64')}`;
return `@font-face { font-family: '${family}'; font-weight: 400; font-style: normal; src: url('${dataUri}') format('woff2'); }`;
} catch (_) {
} catch (err) {
// Non-fatal: fall back to the system monospace stack declared in styles-modern.css.
if (typeof console !== 'undefined') console.warn('[print-preview] font embed failed:', err.message);
return '';
}
}