Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我每次都报错eot不存在呢?说好的自动生成呢 #28

Closed
smiky opened this issue Apr 29, 2015 · 2 comments
Closed

Comments

@smiky
Copy link

smiky commented Apr 29, 2015

报错如下:
D:\Project\JavaScript\webfont>font-spider demo.html
Font name: SourceHanSans-Normal
Original size: 180193.4 KB
Include chars: 中体展思文源现黑
ERROR Error: ENOENT, no such file or directory 'D:\Project\JavaScript\webfont\fo
nts\SourceHanSans-Normal.eot'
at Error (native)
at Object.fs.statSync (fs.js:801:18)
at D:\Program Files\Node\node_modules\font-spider\src\index.js:177:50
at Array.forEach (native)
at D:\Program Files\Node\node_modules\font-spider\src\index.js:175:32
at D:\Program Files\Node\node_modules\font-spider\node_modules\promise\lib\c
ore.js:33:15
at flush (D:\Program Files\Node\node_modules\font-spider\node_modules\promis
e\node_modules\asap\asap.js:27:13)
at process._tickCallback (node.js:355:11)

我的目录结构
webfont
|--fonts
|--SourceHanSans-Normal.ttf
|--demo.html
|--fonts.css
我在webfont目录下运行命令font-spider demo.html就是上面的报错,不是说只要有ttf存在,其他字体都是字蛛自动生成么?

fonts.css内容如下:
@font-face {
font-family: 'SourceHanSans-Normal';
src: url('fonts/SourceHanSans-Normal.eot');
src: url('fonts/SourceHanSans-Normal.eot?#font-spider') format('embedded-opentype'),
url('fonts/SourceHanSans-Normal.woff') format('woff'),
url('fonts/SourceHanSans-Normal.ttf') format('truetype'),
url('fonts/SourceHanSans-Normal.svg') format('svg');
font-weight: normal;
font-style: normal;
}

@zmmbreeze
Copy link

我也遇到过,估计是你的字体的ttf格式不正确。默认下载的思源黑体是otf格式的,仅仅改一个后缀是没用的。换一个字体文件之后就正常了。
可以用我这个思源黑体

@smiky
Copy link
Author

smiky commented Apr 30, 2015

@zmmbreeze 感谢分享~~我下载的的确是otf,我是用FontCreator 8转成ttf后再用font-spider的,估计转出来的文件font-spider不支持

aui pushed a commit that referenced this issue May 9, 2015
@aui aui closed this as completed May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants