font-spider
font-spider copied to clipboard
我在转换汉仪中黑简是报错
C:\Users\YOUNG_9>font-spider C:\Users\YOUNG_9\Desktop\flowPath\flow.html
Optimizer error.
C:\Users\YOUNG_9\Desktop\flowPath\font\FZJT.ttf
Can't locate Digest/SHA.pm in @INC (@INC contains: ext/Font-TTF/lib /usr/lib/per
l5/5.8.8/msys /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/msys /usr/lib/
perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .) at Font/Subsetter.pm line 31.
BEGIN failed--compilation aborted at Font/Subsetter.pm line 31.
Compilation failed in require at ./subset.pl line 11.
BEGIN failed--compilation aborted at ./subset.pl line 11.
我还换了其他字体,还是出现这样的错误。
<style type="text/css">
/*声明 WebFont*/
@font-face {
font-family: 'hyzhj';
src: url('font/hyzhj.eot');
src:
url('font/hyzhj.eot?#font-spider') format('embedded-opentype'),
url('font/hyzhj.woff') format('woff'),
url('font/hyzhj.ttf') format('truetype'),
url('font/hyzhj.svg') format('svg');
font-weight: normal;
font-style: normal;
}
/*使用选择器指定字体*/
.test {
font-family: 'hyzhj';
}
</style>
是我的用法有问题吗?
试下方正字库的字体是否存在此报错?
我试了你给的FZJT.ttf的这个字体,也是报的这个错误。
源码给出的 test 目录也无法运行?如果是这样,可能和你系统的 Perl 环境有关
那我系统需要怎么样的一个Perl环境?
环境问题我也很难定位,你能否在其他机器上先试下?
这个错我也在windows 7 遇到过。确定已经安装好Perl,然后安装font-spider,然后不要用Gitbash等工具执行,直接用CMD执行。
可以将 github 上的源码下载下来,然后执行:
node test/test.js
如果正常,说明你的字体文件不支持(部分ttf包含特殊数据,字蛛暂时无法解析);否则是环境问题
Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\linling\Desktop\font-spider-master\src\index
.js:8:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
出现这个的问题。
使用源码方式安装,你应该先安装依赖:
npm install
我也遇到这个问题,看了下是 perl 缺少模块 cpan,官网在这里 http://www.cpan.org/, 我的是 CentOS 的系统,所以直接执行依赖安装就好了
yum install cpan
感谢!