diff --git a/fixtures/expected/realworld.svg b/fixtures/expected/realworld.svg new file mode 100644 index 0000000..ef7edb8 --- /dev/null +++ b/fixtures/expected/realworld.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/fixtures/icons/realworld/omridevk.svg b/fixtures/icons/realworld/omridevk.svg new file mode 100644 index 0000000..82ae279 --- /dev/null +++ b/fixtures/icons/realworld/omridevk.svg @@ -0,0 +1,5 @@ + + + + diff --git a/src/svgshapes2svgpath.ts b/src/svgshapes2svgpath.ts index 3621a41..0b0f84b 100644 --- a/src/svgshapes2svgpath.ts +++ b/src/svgshapes2svgpath.ts @@ -90,8 +90,8 @@ function svgShapesToPathLineToPath(attributes) { } function svgShapesToPathCircleToPath(attributes) { - const cx = parseFloat(attributes.cx); - const cy = parseFloat(attributes.cy); + const cx = parseFloat(attributes.cx || 0); + const cy = parseFloat(attributes.cy || 0); const rx = 'undefined' !== typeof attributes.rx ? parseFloat(attributes.rx) diff --git a/src/tests/index.test.ts b/src/tests/index.test.ts index 008dcf2..ab243cd 100755 --- a/src/tests/index.test.ts +++ b/src/tests/index.test.ts @@ -281,6 +281,12 @@ describe('Generating fonts to files', () => { }); }); + test('should work with realworld icons', async () => { + await generateFontToFile({ + fontName: 'realworld', + }); + }); + test('should work with a lot of icons', async () => { await generateFontToFile( { diff --git a/src/tests/results/nestedicons-cli.svg b/src/tests/results/nestedicons-cli.svg deleted file mode 100644 index 1fa3f7c..0000000 --- a/src/tests/results/nestedicons-cli.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/tests/results/originalicons-cli.svg b/src/tests/results/originalicons-cli.svg deleted file mode 100644 index 4095d96..0000000 --- a/src/tests/results/originalicons-cli.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - -