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

The css file cannot be generated and an error is reported #225

Closed
zhangxiaochuZXC opened this issue Apr 9, 2024 · 2 comments
Closed

The css file cannot be generated and an error is reported #225

zhangxiaochuZXC opened this issue Apr 9, 2024 · 2 comments

Comments

@zhangxiaochuZXC
Copy link

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"?>
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
Copy link
Author

svg demo:

@jaywcjlove
Copy link
Owner

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

2 participants