rx, ry, xrot is NaN
Closed this issue · 3 comments
Issue
- I've fully read the README recently
- I've searched for existing issues
- I've checked I'm up to date with the latest version of the project
Expected behavior
Actual behavior
The three numbers (rx
, ry
, xrot
) after letter A after converting is always NaN
.
rX
, rY
, xRot
gets NaN
@index.js#L476
Line 476 in dd52533
Steps to reproduce the behavior
let result = ''
const stream = new SVGIcons2SVGFontStream()
.on("data", (data) => {
result += data
})
const file = 'file.svg'
const glyph = fs.createReadStream(file)
glyph.metadata = await getMetadata(file)
stream.write(glyph)
stream.end()
// The generated SVG file
console.log(result)
file.svg
SVG is a minus, made with Inkscape and then compressed with SVGO. I have also tried using the original Inkscape file exported a plain SVG using this guide (by fontello).
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.467 8.467" height="32" width="32"><rect ry=".952" rx="0" y="3.757" x="1.058" height=".952" width="6.35"/></svg>
Debugging informations
node -v
result:
v14.15.0
npm -v
result:
6.14.8
If the result is lower than 6.9.5, there is a poor chance I even have a look to it. Please, use the last NodeJS LTS version.
I tried to convert your path with:
svgicons2svgfont/src/svgshapes2svgpath.js
Lines 14 to 63 in dd52533
The result seems ok : M1.058 3.757h6.35a 0 0.952 0 0 1 0 0.952v-0.952a 0 0.952 0 0 1 0 0.952h-6.35a 0 0.952 0 0 1 0 -0.952v0.952a 0 0.952 0 0 1 0 -0.952z
Probably a problem with yOffset
here :
Line 469 in dd52533
And I guess it comes from the fact you did not setup any options to the SVGIcons2SVGFontStream'a constructor.
No activity so closing the issue.
Sorry, I forgot the issue. I remember solving the issue, but not how I did it.