首页 > @font-face使用思源黑体的问题:“Failed to decode downloaded font”

@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左右),却没有报错。
字体文件:

测试结果:


bug OTS parsing error: CFF : failed to parse table
https://github.com/khaledhosny/ots/issues/75

【热门文章】
【热门文章】