使用说明
安装
npm install font-spider -g
使用
1.在css中使用webFont,例如:
/声明 WebFont/
@font-face {
font-family: ‘pinghei’;
src: url(’…/font/pinghei.eot’);
src:
url(’…/font/pinghei.eot?#font-spider’) format(‘embedded-opentype’),
url(’…/font/pinghei.woff’) format(‘woff’),
url(’…/font/pinghei.ttf’) format(‘truetype’),
url(’…/font/pinghei.svg’) format(‘svg’);
font-weight: normal;
font-style: normal;
}
/使用选择器指定字体/
.home h1, .demo > .test {
font-family: ‘pinghei’;
}
2.在cmd里运行(注意:是通配符,用来匹配所以的html文件):
font-spider ./demo/.html