-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to SVG paths with attribute fill-rule "evenodd" and partial support for paths with stroke attribute (only some icons tested) #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it should be merged. A question though is, is it the SVG fonts that do not support those SVG details or the svg2ttf converter. If so, maybe that the PR should be done there.
strokeWidth, | ||
hasFillAttr | ||
); | ||
var pngBuffer = await Svg2(svgBuffer).png({ transparent: false }).toBuffer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting the SVG to a PNG and then to an SVG again seems like a huge process to only suppot stroke regarding the fact that not everyone need it. Indeed most of iconfont designers knows the limitations of iconfonts and then avoir using unsupported SVG features or at least convert the SVGs upstream. I'm not sure it worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, in my case it has happened to me many times, the designers give you the icon and you have to find how to adapt it, in this case it seemed like a good addition to avoid wasting time. Even if it is a partial support.
@@ -831,7 +831,7 @@ describe('Providing bad glyphs', () => { | |||
unicode: ['\uE002'], | |||
}; | |||
|
|||
let firstError = true; | |||
/*let firstError = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code is not useful anymore, best is to remove it then comment it. Why is it removed btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because when I change the sax library for saxasync, the latter does not throw the error that the original one does and I don't know why or if that test is really necessary.
@@ -23,10 +23,10 @@ | |||
"cz": "env NODE_ENV=${NODE_ENV:-cli} git cz", | |||
"lint": "eslint src/*.js bin/*.js tests/*.mocha.js", | |||
"metapak": "metapak", | |||
"mocha": "mocha tests/*.mocha.js", | |||
"mocha": "mocha tests/*.mocha.js --timeout 10000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that the need to add a timeout is an indicator of the fact that we should not support fill-rule attributes, at least, not by converting from svg to png and back to svg then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout extend is for the async version of the sax library, it takes more time to process when you have strokes for the conversion.
In this case is this library the problem, but, I can keep the stroke part on my fork... |
Fixes #62 and try to fix #60
Proposed changes
Added paperjs to handle fill-rule "evenodd"
Code quality
contributors
field of the package.json file
License
To get your contribution merged, you must check the following.
Join
My NPM username: ramirezcgn