Skip to content
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

Conversion alters shapes #24

Closed
cameronmcefee opened this issue Jun 17, 2014 · 7 comments
Closed

Conversion alters shapes #24

cameronmcefee opened this issue Jun 17, 2014 · 7 comments

Comments

@cameronmcefee
Copy link

Given the source:

screen shot 2014-06-16 at 6 42 59 pm

The result is this:

screen shot 2014-06-16 at 6 40 44 pm

The issue appears to happen when converting from svg font -> ttf. I tested this by switching the font-face declaration to only use the svg font, which looks great.

I don't notice this issue in Fontello icons (which I presume use this lib), so I'm not sure why I'm experiencing this.

Reference:
https://github.com/github/octicons/blob/master/svg/link.svg
http://octicons.github.com/icon/link/

@cameronmcefee
Copy link
Author

Interestingly, these erratic paths seem to happen on arcs that only have a bezier curve on one end. Paths that have two curved ends seem to render nicely.

@cameronmcefee
Copy link
Author

Alright, I've confirmed that ensuring that each side of a point has a bezier curve will smooth the points, so it's an issue of how the icon is drawn. I can solve this issue myself, but since the svg looks different the the ttf, I'll let you decide if that's a bug.

@puzrin
Copy link
Member

puzrin commented Jun 17, 2014

TTF understands only quadratic beziers. Svg allows cubic.

cubic -> quad approximation algorythm is simplified, and can have deviations on edge cases. Usually, when you draw glyphs in font editor, it saves data with quadratic beziers, and you will never see this problem.

With current convertor i'd recommend to add more points. Or if anyone wish, he can rewrite this https://github.com/fontello/svg2ttf/blob/master/lib/math.js#L39-L75 cubic2quad function to something better.

@puzrin
Copy link
Member

puzrin commented Jun 17, 2014

Closed in flavour of #25.

PS. I have no plans to fix it myself, but if anyone wish - there are link to article with all details about math.

@puzrin puzrin closed this as completed Jun 17, 2014
@cameronmcefee
Copy link
Author

Thanks for the explanation @puzrin. I always learn a lot from opening issues on your repos 😃

@puzrin
Copy link
Member

puzrin commented Nov 2, 2015

@cameronmcefee FYI, after ages... fixed :)

@cameronmcefee
Copy link
Author

🎉 Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants