feat(fonts): add bundled fonts and per-book font model

Add EB Garamond, Lora, Source Serif 4, and Fraunces (OFL variable
fonts) and a font catalog with body/heading pairings. Store the chosen
fonts per book in BookSettings.fonts, defaulting to Literata so existing
books are unchanged.
This commit is contained in:
pj committed 2026-06-22 14:18:57 -04:00
1 parent 33ef53936e
commit 124c1947c1
15 files changed
+476 -3

No files matched your search

+2 -1
View File
@@ -2,6 +2,7 @@ import { invoke } from "@tauri-apps/api/core";
import { open } from "@tauri-apps/plugin-dialog";
import type { JSONContent } from "@tiptap/core";
import { type Book, type BookMetadata, type Chapter, type Cover, createCover } from "../model/book";
import { DEFAULT_FONTS } from "../model/fonts";
export interface RawFile {
path: string;
@@ -515,7 +516,7 @@ export function filesToBook(files: RawFile[], fallbackName = "Imported book"): B
id: crypto.randomUUID(),
metadata,
theme: "quiet-press",
settings: { trim: "6x9", bleed: true },
settings: { trim: "6x9", bleed: true, fonts: DEFAULT_FONTS },
cover: findCover(opf, manifest, byPath),
chapters,
};