svgicons2svgfont
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -21,2 +21,4 @@ #! /usr/bin/env node | ||
.option('-d, --descent [value]', 'the font descent [0].', parseInt) | ||
.option('-s, --startunicode [value]', 'the start unicode codepoint for unprefixed files [0xEA01].', parseInt) | ||
.option('-a, --appendunicode', 'prefix files with their allocated unicode codepoint.', parseInt) | ||
.parse(process.argv); | ||
@@ -29,3 +31,7 @@ | ||
SVGIconsDirStream(program.args) | ||
SVGIconsDirStream(program.args, { | ||
startUnicode: program.startunicode, | ||
appendUnicode: program.appendunicode, | ||
log: program.v ? console.log : function() {} | ||
}) | ||
.pipe(SVGIcons2SVGFontStream({ | ||
@@ -32,0 +38,0 @@ fontName: program.fontname, |
{ | ||
"name": "svgicons2svgfont", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Read a set of SVG icons and ouput a SVG font", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/nfroidure/svgicons2svgfont", |
@@ -75,2 +75,24 @@ # svgicons2svgfont | ||
There is a few more options for the CLI interface, you can list all of them: | ||
```js | ||
svgicons2svgfont --help | ||
# Usage: svgicons2svgfont [options] <icons ...> | ||
# | ||
# Options: | ||
# | ||
# -h, --help output usage information | ||
# -V, --version output the version number | ||
# -v, --verbose tell me everything! | ||
# -o, --output [/dev/stdout] Output file. | ||
# -f, --fontname [value] the font family name you want [iconfont]. | ||
# -w, --fixedWidth creates a monospace font of the width of the largest input icon. | ||
# -c, --centerhorizontally calculate the bounds of a glyph and center it horizontally. | ||
# -n, --normalize normalize icons by scaling them to the height of the highest icon. | ||
# -h, --height [value] the outputted font height [MAX(icons.height)]. | ||
# -r, --round [value] setup the SVG path rounding [10e12]. | ||
# -d, --descent [value] the font descent [0]. | ||
# -s, --startunicode [value] the start unicode codepoint for unprefixed files [0xEA01]. | ||
# -a, --appendunicode prefix files with their allocated unicode codepoint. | ||
``` | ||
## API | ||
@@ -77,0 +99,0 @@ |
@@ -18,3 +18,3 @@ var fs = require('fs'); | ||
if(!(this instanceof SVGIconsDirStream)) { | ||
return new SVGIconsDirStream(dir); | ||
return new SVGIconsDirStream(dir, options); | ||
} | ||
@@ -21,0 +21,0 @@ |
@@ -6,3 +6,2 @@ var path = require('path'); | ||
var usedUnicodes = []; | ||
// Default options | ||
@@ -13,3 +12,3 @@ options = options || {}; | ||
options.startUnicode : | ||
0xE001; | ||
0xEA01; | ||
options.log = options.log || console.log; | ||
@@ -16,0 +15,0 @@ options.err = options.err || console.err; |
@@ -11,2 +11,3 @@ var svgicons2svgfont = require(__dirname + '/../src/index.js'); | ||
' -o ' + __dirname + '/results/originalicons-cli.svg' + | ||
' -s 0xE001' + | ||
' ' + __dirname + '/fixtures/originalicons/*.svg ', | ||
@@ -13,0 +14,0 @@ function(err) { |
@@ -25,3 +25,5 @@ var assert = require('assert'); | ||
SVGIconsDirStream(__dirname + '/fixtures/' + options.fontName) | ||
SVGIconsDirStream(__dirname + '/fixtures/' + options.fontName, { | ||
startUnicode: 0xE001 | ||
}) | ||
.pipe(svgFontStream); | ||
@@ -48,3 +50,5 @@ } | ||
SVGIconsDirStream(__dirname + '/fixtures/' + options.fontName) | ||
SVGIconsDirStream(__dirname + '/fixtures/' + options.fontName, { | ||
startUnicode: 0xE001 | ||
}) | ||
.pipe(svgFontStream); | ||
@@ -51,0 +55,0 @@ |
@@ -14,3 +14,3 @@ var metadata = require(__dirname + '/../src/metadata.js'); | ||
name: 'hello', | ||
unicode: [String.fromCharCode(0xE001)] | ||
unicode: [String.fromCharCode(0xEA01)] | ||
} | ||
@@ -25,5 +25,5 @@ ); | ||
log: function() { | ||
assert(fs.existsSync(__dirname + '/results/uE001-plop.svg')); | ||
assert(fs.existsSync(__dirname + '/results/uEA01-plop.svg')); | ||
assert(!fs.existsSync(__dirname + '/results/plop.svg')); | ||
fs.unlinkSync(__dirname + '/results/uE001-plop.svg'); | ||
fs.unlinkSync(__dirname + '/results/uEA01-plop.svg'); | ||
done(); | ||
@@ -36,3 +36,3 @@ }, | ||
name: 'plop', | ||
unicode: [String.fromCharCode(0xE001)] | ||
unicode: [String.fromCharCode(0xEA01)] | ||
} | ||
@@ -39,0 +39,0 @@ ); |
283904
1389
202