-
Notifications
You must be signed in to change notification settings - Fork 34
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
node-potrace results are different from online demo. #7
Comments
Not sure. To clarify, I don't see "distorted and weird", I see no knocked-out center on the 2nd one. Obviously some difference between the output is resulting in an issue later on in your conversion pipeline. I opened both of your samples in Affinity Designer and they both look fine, so there's nothing obviously wrong with the SVGs. I see that the node-potrace one has a I would take this up with Webfont and see if someone there can tell what about your input is causing that issue. Otherwise it's a guessing game because there's nothing obviously wrong with the output from node-potrace. |
Ya, "distorted and weird" was the wrong way to put it is just missing the inner cutouts. I was just thinking that maybe somewhere during the porting process a few adjustments were made to the node version, since the output of this package does not match the output of the JS Port (The version used by the online demo). I know you are not the one who did the port (just the maintainer, thank you for that by the way). But I was thinking maybe we should try and get the exact result that the JS Port produces here on node since its a port? |
The port actually didn't change the output at all, it was just a code-packaging change, but there have been several subsequent patches and adjustments that altered the behavior. I sympathize with your issue but I don't think we will be undoing all of those, especially since the SVG output seems fine. Rightly or wrongly, that ship has sailed. However, if we can identify what about the current output is producing that behavior, (if it is at all) then we can consider a fix. My suggestion is to check with the folk(s) at Webfont, and/or play around with the node-potrace output (remove that viewport attribute, shift spaces around) and see if you can find a cause. |
Ok thanks, I will see what I can do. |
WIP: this is super slow? This is nice because it means people don't have to install a native dependency to try things out. Unfortunately, potrace in javascript looks like a bit of a mess: - There's an unmaintained port from 4 years ago: https://github.com/kilobtye/potrace - There's a fork of that which is NodeJS compatible, "with some additions": https://github.com/Iwasawafag/node-potrace - There's this fork of *that* which some additional commits, I can't figure out what it's relationship to the `Iwasawafag` fork is: https://github.com/tooolbox/node-potrace/. (tooolbox/node-potrace#13) - Unfortunately, one or more of the "additions" in the `Iwasawafag` and `toolbox` forks introduce issues with generating fonts, which there's yet another fork designed to fix. See tooolbox/node-potrace#7 and https://github.com/oslllo/potrace/. So, I've introduced a dependency on the `oslllo` fork of a fork of a fork of a fork. 😱
The key to the problem is the fill-rule attribute. Although the output of the Online Demo is |
On the surface node-potrace works fantastic, but it gets a bit complicated when I want to convert the traced svg icons into fonts. The online demo generates icons that are font friendly but icons generated by node-potrace icons are coming out distorted and weird when converted into fonts. They come out fine as svgs but are unusable as fonts.
I'm using Webfont to convert the icons to fonts and Fontdrop.info to preview the fonts.
potrace.trace()
default parameters
Examples
Source Image We Feed To Potrace
![Source Image](https://user-images.githubusercontent.com/20132952/79676465-db4ded80-81e6-11ea-8e9d-beacd55e966a.png)
Online Demo
Resulting SVG
Resulting Icon As Font
✔️
Node-Potrace
Resulting SVG
Resulting Icon As Font
❌
The text was updated successfully, but these errors were encountered: