diff --git a/bin/svgicons2svgfont.js b/bin/svgicons2svgfont.js index 26cb00a..20348dc 100755 --- a/bin/svgicons2svgfont.js +++ b/bin/svgicons2svgfont.js @@ -25,7 +25,7 @@ program 'creates a monospace font of the width of the largest input icon' ) .option( - '-c, --centerhorizontally', + '-c, --centerHorizontally', 'calculate the bounds of a glyph and center it horizontally' ) .option( @@ -92,6 +92,7 @@ new SVGIconsDirStream(files, { normalize: options.normalize, preserveAspectRatio: options.preserveAspectRatio, fontHeight: options.height, + fontWeight: options.weight, round: options.round, descent: options.descent, ascent: options.ascent, diff --git a/src/index.js b/src/index.js index 284732e..f1d32e3 100755 --- a/src/index.js +++ b/src/index.js @@ -489,7 +489,7 @@ class SVGIcons2SVGFontStream extends Transform { glyphPath.getBounds(); if (this._options.centerHorizontally) { glyphPath.translate( - (glyph.width - (bounds.maxX - bounds.minX)) / 2 - bounds.minX + (glyph.width - (bounds.maxX - bounds.minX)) / 2 ); } if (this._options.centerVertically) {