From d6402ee6fbbe70cefe1dea91ec089bcbad3159d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramirez=20Nicol=C3=A1s?= Date: Sat, 18 Sep 2021 17:25:45 -0300 Subject: [PATCH 1/2] Fix normalize with long Icons --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 44687c9..ae81060 100755 --- a/src/index.js +++ b/src/index.js @@ -433,7 +433,7 @@ class SVGIcons2SVGFontStream extends Transform { this.glyphs.forEach((glyph) => { const ratio = this._options.normalize - ? fontHeight / glyph.height + ? fontHeight / (glyph.width > glyph.height ? glyph.width : glyph.height) : fontHeight / maxGlyphHeight; if (!isFinite(ratio)) throw new Error('foo'); glyph.width *= ratio; From 54dd0e618868a8ff07c9c5fbf6cb8ca143174437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramirez=20Nicol=C3=A1s?= Date: Sat, 18 Sep 2021 17:36:47 -0300 Subject: [PATCH 2/2] Fix tests --- tests/expected/variableheighticonsn.svg | 4 ++-- tests/results/variableheighticonsn.svg | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/expected/variableheighticonsn.svg b/tests/expected/variableheighticonsn.svg index d07e453..3096249 100644 --- a/tests/expected/variableheighticonsn.svg +++ b/tests/expected/variableheighticonsn.svg @@ -9,7 +9,7 @@ + horiz-adv-x="150" d="M75 30L120 80L30 80z" /> @@ -18,7 +18,7 @@ horiz-adv-x="150" d="M100 75L50 120L50 30z" /> + horiz-adv-x="150" d="M75 80L120 30L30 30z" /> diff --git a/tests/results/variableheighticonsn.svg b/tests/results/variableheighticonsn.svg index d07e453..3096249 100644 --- a/tests/results/variableheighticonsn.svg +++ b/tests/results/variableheighticonsn.svg @@ -9,7 +9,7 @@ + horiz-adv-x="150" d="M75 30L120 80L30 80z" /> @@ -18,7 +18,7 @@ horiz-adv-x="150" d="M100 75L50 120L50 30z" /> + horiz-adv-x="150" d="M75 80L120 30L30 30z" />