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

在线分包出现以下报错 #35

Closed Lemonreds closed 9 months ago

Lemonreds commented 10 months ago
image

使用在线分包出现以下报错: Cannot read properties of undefined (reading 'glyphIndexMap') 请问是什么原因呢?

Lemonreds commented 10 months ago

请问是否是字体文件的问题呢? woff2格式的

KonghaYao commented 9 months ago

cn-font-split 默认没有对 woff2 进行转换,所以会报错,你可以使用 otf 或者 ttf 版本的字体哦。线上版本将会在这周上线对 woff2 和 woff 字体的解析哈 😘

image
KonghaYao commented 9 months ago

我回去看了看代码, cn-font-split 对 woff2 字体进行了解析,但是这个包内的 woff2 转换成为 ttf 格式时发生了一些变化,导致了程序阻断

KonghaYao commented 9 months ago

BUG 认定为这个包的 woff2 使用了非常特殊的操作,使得其不能被转化为 ttf 字体类型,后续操作都无法继续使用。对于此种字体的解决方式暂无,但是鉴于字体一般都会提供 otf 和 ttf,这个 BUG 暂时无法修复。

KonghaYao commented 9 months ago

@Lemonreds 此 BUG 已在 4.10.6 修复,感谢您的反馈哦 😊