Skip to content

Commit 7e19873

Browse files
committed
Use TTF fonts for textToPath (opentype.js cannot parse woff2)
1 parent fb6db69 commit 7e19873

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/lib/export/svg/renderer.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,11 @@ const KATEX_CDN = 'https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/fonts';
3333

3434
/** Font mapping for dom2svg textToPath conversion */
3535
const EXPORT_FONTS: FontMapping = {
36-
// UI fonts (bundled)
37-
Inter: [
38-
{ url: '/fonts/Inter-Regular.woff2', weight: 400, style: 'normal' },
39-
{ url: '/fonts/Inter-Medium.woff2', weight: 500, style: 'normal' },
40-
{ url: '/fonts/Inter-SemiBold.woff2', weight: 600, style: 'normal' }
41-
],
36+
// UI fonts — TTF for opentype.js compatibility (woff2 not supported by opentype.js v1.x)
37+
Inter: { url: '/fonts/InterVariable.ttf' },
4238
'JetBrains Mono': [
43-
{ url: '/fonts/JetBrainsMono-Regular.woff2', weight: 400, style: 'normal' },
44-
{ url: '/fonts/JetBrainsMono-Medium.woff2', weight: 500, style: 'normal' }
39+
{ url: '/fonts/JetBrainsMono-Regular.ttf', weight: 400, style: 'normal' },
40+
{ url: '/fonts/JetBrainsMono-Medium.ttf', weight: 500, style: 'normal' }
4541
],
4642
// KaTeX math fonts (CDN)
4743
KaTeX_Main: [

static/fonts/InterVariable.ttf

859 KB
Binary file not shown.
264 KB
Binary file not shown.
264 KB
Binary file not shown.

0 commit comments

Comments
 (0)