svgtofont
svgtofont copied to clipboard
The css file cannot be generated and an error is reported
demo:
svgtofont({
src: icons_pro, // svg path
dist: path.resolve(process.cwd(), fonts/${project.name}
), // output path
styleTemplates: path.resolve(process.cwd(), styles/${project.name}
), // file templates path (optional)
fontName: 'fs-ava', // font name
classNamePrefix: 'ava-',
// css: true, // Create CSS files.
css: {
fontSize: true,
output: path.resolve(process.cwd(), styles/${project.name}
),
cssPath: '../styles/',
include: '\.(css)$',
fileName: 'fs-ava-styles',
},
startUnicode: 0xea01, // unicode start number
svgicons2svgfont: {
fontHeight: 1024,
normalize: true
},
// website = null, no demo html files
})
result:
Font created
SUCCESS SVG font successfully created!
╰┈▶./fonts/75255_zhangj/fs-ava.svg
GET /ava/projects 304 59.558 ms - -
SUCCESS TTF font successfully created!
╰┈▶ ./fonts/75255_zhangj/fs-ava.ttf
SUCCESS EOT font successfully created!
╰┈▶ ./fonts/75255_zhangj/fs-ava.eot
GET /ava/projects/icons/3 200 30.489 ms - 4998
SUCCESS WOFF font successfully created!
╰┈▶ ./fonts/75255_zhangj/fs-ava.woff
SUCCESS WOFF2 font successfully created!
╰┈▶ ./fonts/75255_zhangj/fs-ava.woff2
SvgToFont:CLI:ERR: Error: Unmatched selector: ="1.0" standalone="no"?><svg t="1705041684707" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1228" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
@zhangxiaochuZXC If you want me to help you, you need to provide an example that reproduces the error.