mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-02 19:17:03 +00:00
feat(fonts): honor selected fonts in PDF export
Interpolate the book's body and heading families into the Typst preamble, title page, cover, and contents. Embed the needed bundled fonts and load any chosen system fonts (via fontdb) into the Typst engine so PDF preview and export match the on-screen fonts.
This commit is contained in:
1 parent
9a38976000
commit
7a2d7c6aff
5 files changed
+93
-21
No files matched your search
@@ -107,8 +107,8 @@ function PdfDock() {
|
||||
clearTimeout(timer.current);
|
||||
setBusy(true);
|
||||
timer.current = setTimeout(() => {
|
||||
const { source, images } = coverActive ? coverToPdfInputs(book) : chapterToPdfInputs(book, idx);
|
||||
compilePdf(source, images)
|
||||
const { source, images, fonts } = coverActive ? coverToPdfInputs(book) : chapterToPdfInputs(book, idx);
|
||||
compilePdf(source, images, false, fonts)
|
||||
.then((bytes) => {
|
||||
setPdf(bytes);
|
||||
setError(null);
|
||||
|
||||
Reference in new issue
Block a user