feat(reader): increase font file size limit to 50MB for CJK fonts

Increase MAX_FONT_FILE_SIZE to 50MB to support large CJK and non-alphabetic fonts. Implement a lightweight binary font metadata parser to replace opentype.js buffer parsing, and update reader custom font composables to lazily manage blob URLs per font family.

Closes #793
This commit is contained in:
neon
2026-07-31 23:37:32 +00:00
parent d26f6999b4
commit 02debbe543
12 changed files with 13222 additions and 6766 deletions
+3 -1
View File
@@ -42,7 +42,9 @@ export const FONT_FORMAT_CSS_FORMAT: Record<FontFormat, string> = {
woff2: "woff2",
};
export const MAX_FONT_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
// Sized for CJK and other non-alphabetic fonts, which routinely exceed 30 MB because
// they carry tens of thousands of glyphs.
export const MAX_FONT_FILE_SIZE = 50 * 1024 * 1024; // 50 MB
export const MAX_FONTS_PER_USER = 50;
export const FONT_WEIGHTS = [100, 200, 300, 400, 500, 600, 700, 800, 900] as const;