KonghaYao / cn-font-split

划时代的字体切割工具,CJK与任何字符!支持 otf、ttf、woff2 字体多线程切割,完美地细颗粒度地进行包大小控制。A revolutionary font subetter that supports CJK and any characters! It enables multi-threaded subset of otf, ttf, and woff2 fonts, allowing for precise control over package size.
https://chinese-font.netlify.app/
Apache License 2.0
442 stars 15 forks source link

window环境下,nextjs使用vite-plugin-font会解析路径失败 #63

Closed ShawDuChen closed 3 months ago

ShawDuChen commented 3 months ago
Snipaste_2024-06-06_17-36-08

原因应该是路径符号的问题

Snipaste_2024-06-06_17-39-13
KonghaYao commented 3 months ago

抽象了,不支持绝对路径。。。。

ShawDuChen commented 3 months ago

抽象了,不支持绝对路径。。。。

我这边尝试的解决方案是,使用url.fileURLToPath()来转换URL格式的文件路径,改成这样可以正确解析(不过仅对windows,其他环境还不确定)

Snipaste_2024-06-06_17-45-11
KonghaYao commented 3 months ago

@ShawDuChen 1.0.2 版本修复了 Windows 的路径问题,MacOS 上通过了测试,这个路径是可以的