font-spider icon indicating copy to clipboard operation
font-spider copied to clipboard

我在转换汉仪中黑简是报错

Open lzbSun opened this issue 10 years ago • 11 comments

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>

是我的用法有问题吗?

lzbSun avatar Jan 08 '15 06:01 lzbSun

试下方正字库的字体是否存在此报错?

aui avatar Jan 08 '15 07:01 aui

我试了你给的FZJT.ttf的这个字体,也是报的这个错误。

lzbSun avatar Jan 08 '15 08:01 lzbSun

源码给出的 test 目录也无法运行?如果是这样,可能和你系统的 Perl 环境有关

aui avatar Jan 08 '15 08:01 aui

那我系统需要怎么样的一个Perl环境?

lzbSun avatar Jan 08 '15 09:01 lzbSun

环境问题我也很难定位,你能否在其他机器上先试下?

aui avatar Jan 10 '15 13:01 aui

这个错我也在windows 7 遇到过。确定已经安装好Perl,然后安装font-spider,然后不要用Gitbash等工具执行,直接用CMD执行。

airyland avatar Jan 10 '15 15:01 airyland

可以将 github 上的源码下载下来,然后执行:

node test/test.js

如果正常,说明你的字体文件不支持(部分ttf包含特殊数据,字蛛暂时无法解析);否则是环境问题

aui avatar Jan 11 '15 05:01 aui

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)

出现这个的问题。

lzbSun avatar Jan 20 '15 08:01 lzbSun

使用源码方式安装,你应该先安装依赖:

npm install

aui avatar Jan 20 '15 09:01 aui

我也遇到这个问题,看了下是 perl 缺少模块 cpan,官网在这里 http://www.cpan.org/, 我的是 CentOS 的系统,所以直接执行依赖安装就好了

 yum install cpan

alphatr avatar Jan 26 '15 02:01 alphatr

感谢!

aui avatar Jan 26 '15 03:01 aui