mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-03 03:27:03 +00:00
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:
1 parent
33ef53936e
commit
124c1947c1
15 files changed
+476
-3
No files matched your search
+2
-1
@@ -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,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user