nfroidure / gulp-svgicons2svgfont

Bundle several SVG icons to a single SVG font
MIT License
45 stars 20 forks source link

not emit error #21

Closed alexander-akait closed 9 years ago

alexander-akait commented 9 years ago

I use broke .svg and get error

events.js:72
        throw er; // Unhandled 'error' event
              ^
SyntaxError: Unterminated command at index 173.
    at SVGPathDataParser._transform (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/svgicons2svgfont/node_modules/svg-pathdata/src/SVGPathDataParser.js:359:15)
    at SVGPathDataParser.Transform._read (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at SVGPathDataParser.Transform._write (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at SVGPathDataParser.Writable.write (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at Function.SVGPathData.parse (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/svgicons2svgfont/node_modules/svg-pathdata/src/SVGPathData.js:112:10)
    at new SVGPathData (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/svgicons2svgfont/node_modules/svg-pathdata/src/SVGPathData.js:2:31)
    at applyTransforms (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/svgicons2svgfont/src/index.js:33:24)
    at SAXStream.<anonymous> (/.../node_modules/gulp-iconfont/node_modules/gulp-svgicons2svgfont/node_modules/svgicons2svgfont/src/index.js:301:22)

My code:

// ...
.pipe($.iconfont({
     woff2: true,
     fontName: 'app-' + bundle + '-font',
    normalize: true,
    appendCodepoints: false
}))
.on('error', function (error) {
    utils.log(utils.colors.red(error));
    this.emit('end');
})
// ...

And error not fired :(