mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-24 07:20:16 +05:30
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:
@@ -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 '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user