svgtofont icon indicating copy to clipboard operation
svgtofont copied to clipboard

The css file cannot be generated and an error is reported

Open zhangxiaochuZXC opened this issue 4 months ago • 2 comments

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"> at parse (./node_modules/css-what/lib/commonjs/parse.js:85:15) at Object.select (./node_modules/cheerio-select/lib/index.js:191:68) at LoadedCheerio.find (./node_modules/cheerio/lib/api/traversing.js:90:30) at initialize (./node_modules/cheerio/lib/load.js:156:34) at ./node_modules/svgtofont/lib/utils.js:238:29 at Array.forEach () at ./node_modules/svgtofont/lib/utils.js:235:37 at new Promise () at createSvgSymbol (./node_modules/svgtofont/lib/utils.js:234:12) at exports.default (./node_modules/svgtofont/lib/index.js:123:43) done!

zhangxiaochuZXC avatar Apr 09 '24 06:04 zhangxiaochuZXC

@zhangxiaochuZXC If you want me to help you, you need to provide an example that reproduces the error.

jaywcjlove avatar Apr 11 '24 16:04 jaywcjlove