From dbf35e99012f145b1bf8a9da32d4b0c5f3efaec1 Mon Sep 17 00:00:00 2001 From: Nicos Belo Karalis Date: Thu, 9 Mar 2023 14:49:29 +0100 Subject: [PATCH 1/3] Fixed param name typo --- bin/svgicons2svgfont.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/svgicons2svgfont.js b/bin/svgicons2svgfont.js index 26cb00a..ebff9bf 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( From 10da25394ce72b48086ff4e500ba0e8e3acddffd Mon Sep 17 00:00:00 2001 From: Nicos Belo Karalis Date: Thu, 9 Mar 2023 14:57:32 +0100 Subject: [PATCH 2/3] fixed font weight not being set --- bin/svgicons2svgfont.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/svgicons2svgfont.js b/bin/svgicons2svgfont.js index ebff9bf..20348dc 100755 --- a/bin/svgicons2svgfont.js +++ b/bin/svgicons2svgfont.js @@ -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, From 1175f47623e5e1bed1dc94ea4d53351f3c61cdc1 Mon Sep 17 00:00:00 2001 From: Nicos Belo Karalis Date: Thu, 9 Mar 2023 15:03:57 +0100 Subject: [PATCH 3/3] Fixed horizontal center --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {