svgicons2svgfont
Advanced tools
Comparing version 0.1.1 to 0.2.0
{ | ||
"name": "svgicons2svgfont", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Read a set of SVG icons and ouput a SVG font", | ||
@@ -26,9 +26,9 @@ "homepage": "https://github.com/nfroidure/svgicons2svgfont", | ||
"svg-pathdata": "0.0.6", | ||
"readable-stream": "^1.0.27-1" | ||
"readable-stream": "^1.0.32" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.20.1", | ||
"mocha": "~1.21.4", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"coveralls": "~2.10.1", | ||
"istanbul": "~0.2.13", | ||
"coveralls": "~2.11.2", | ||
"istanbul": "~0.3.2", | ||
"sax": "~0.6.0" | ||
@@ -35,0 +35,0 @@ }, |
@@ -79,2 +79,7 @@ # svgicons2svgfont | ||
#### options.round | ||
Type: `Number` | ||
Default value: `10e12` | ||
Setup SVG path rounding. | ||
#### options.descent | ||
@@ -81,0 +86,0 @@ Type: `Number` |
@@ -51,2 +51,3 @@ /* | ||
options.descent = options.descent || 0; | ||
options.round = options.round || 10e12; | ||
var outputStream = new Stream.PassThrough() | ||
@@ -133,10 +134,10 @@ , log = (options.log || console.log.bind(console)) | ||
// Move to the line start | ||
'M' + parseFloat(tag.attributes.x1,10).toString(10) | ||
+ ' ' + parseFloat(tag.attributes.y1,10).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.x1,10)+1).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.y1,10)+1).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.x2,10)+1).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.y2,10)+1).toString(10) | ||
+ ' ' + parseFloat(tag.attributes.x2,10).toString(10) | ||
+ ' ' + parseFloat(tag.attributes.y2,10).toString(10) | ||
'M' + (parseFloat(tag.attributes.x1,10)||0).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.y1,10)||0).toString(10) | ||
+ ' ' + ((parseFloat(tag.attributes.x1,10)||0)+1).toString(10) | ||
+ ' ' + ((parseFloat(tag.attributes.y1,10)||0)+1).toString(10) | ||
+ ' ' + ((parseFloat(tag.attributes.x2,10)||0)+1).toString(10) | ||
+ ' ' + ((parseFloat(tag.attributes.y2,10)||0)+1).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.x2,10)||0).toString(10) | ||
+ ' ' + (parseFloat(tag.attributes.y2,10)||0).toString(10) | ||
+ 'Z', parents | ||
@@ -232,2 +233,3 @@ )); | ||
.ySymetry(glyph.height - options.descent) | ||
.round(options.round) | ||
.encode(); | ||
@@ -252,2 +254,3 @@ }); | ||
.translate(((glyph.width - (bounds.x2 - bounds.x1)) / 2) - bounds.x1) | ||
.round(options.round) | ||
.encode(); | ||
@@ -267,3 +270,3 @@ } | ||
outputStream.on('finish', function() { | ||
log("Font created!"); | ||
log("Font created"); | ||
'function' === (typeof options.callback) && (options.callback)(glyphs); | ||
@@ -270,0 +273,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
611
125
124485
Updatedreadable-stream@^1.0.32