refactor changes

This commit is contained in:
pj committed 2026-08-30 16:59:00 +05:30
1 parent df1a447a79
commit d4318554f6
36 files changed
+1251 -291

No files matched your search

+6 -2
View File
@@ -1,7 +1,7 @@
import type { JSONContent } from "@tiptap/core";
import { invoke } from "@tauri-apps/api/core";
import { type Book, type FigurePlacement, TRIM_DIMS, FIGURE_WIDTH, bodyNumber, chapterKind, isResizablePlacement, partNumber, partRoman } from "../model/book";
import { fontStack, fontsUsed } from "../model/fonts";
import { bundledFont, fontStack, fontsUsed } from "../model/fonts";
export interface EpubFile {
path: string;
@@ -66,7 +66,11 @@ async function fetchFontBase64(file: string): Promise<string | null> {
}
async function loadFontAssets(book: Book): Promise<FontAssets> {
const used = fontsUsed(book.settings.fonts).bundled;
// Ids from the shared helper, resolved back to records: an EPUB embeds the font files, so this
// is the one caller that needs a face's filenames rather than its name.
const used = fontsUsed(book.settings.fonts)
.bundled.map((id) => bundledFont(id))
.filter((font) => font !== undefined);
const files: EpubFile[] = [];
const faces: string[] = [];
const manifest: string[] = [];