@font-face使用思源黑体的问题:“Failed to decode downloaded font”
问题如下:
当使用从Google官网下载的NotoSansCJKsc-hinted字体包(109M)和github上下载的source-han-sans-sc字体包,如下:
CSS:
@font-face{
font-family: 'NotoSansSC';
src:url(fonts/NotoSansHans-Regular.otf) format('opentype');
font-weight: 400;
}
.NotoSansCJKsc p{
font-family: NotoSansCJKsc;
}
@font-face{
font-family: 'SourceHanSansSC';
src:url(fonts/SourceHanSansSC/SourceHanSansSC-Regular.otf) format('opentype');
font-weight: 400;
}
.SourceHanSansSC p{
font-family: SourceHanSansSC;
}
在chrome中测试发现以下错误:
Failed to decode downloaded font: http://127.0.0.1:8080/Test/css/fonts/NotoSansCJKsc/NotoSansCJKsc-Regular.otf
fonts.html:1 OTS parsing error: CFF : failed to parse table
fonts.html:1 Failed to decode downloaded font: http://127.0.0.1:8080/Test/css/fonts/SourceHanSansSC/SourceHanSansSC-Regular.otf
fonts.html:1 OTS parsing error: CFF : failed to parse table
图片描述
不知道有没有人遇到这个问题,如何解决?
注: 我在网上下载了另一个版本的NotoSans(48M左右),却没有报错。
字体文件:
测试结果:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
bug OTS parsing error: CFF : failed to parse table
https://github.com/khaledhosny/ots/issues/75