【文件属性】:
文件名称:svg-font-parser:SVG字体解析器
文件大小:88KB
文件格式:ZIP
更新时间:2021-04-30 23:47:46
JavaScript
svg-font-parser
SVG字体解析器
安装
npm install svg - font - parser
用法
var fs = require ( 'fs' ) ;
var parser = require ( 'svg-font-parser' ) ;
fs . readFile ( 'font.svg' , function ( err , contents ) {
if ( err ) throw err ;
parser ( contents ) . then ( function ( result ) {
console . log ( result ) ;
} ) ;
} ) ;
输出:
[
{
...
" family " : " SourceSansPro-Regular " ,
" weight " : [ " 400 " ]
【文件预览】:
svg-font-parser-master
----.travis.yml(70B)
----index.js(557B)
----package.json(650B)
----test()
--------pathFont.svg(503KB)
--------test.js(522B)
--------expected.json(766B)
----LICENSE(1KB)
----.npmignore(57B)
----.gitignore(27B)
----CHANGELOG.md(38B)
----lib()
--------font-face()
--------font()
----README.md(615B)