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

Improve cubic bezier curves approximation with quadratic beziers #25

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

Improve cubic bezier curves approximation with quadratic beziers #25

puzrin opened this issue Jun 17, 2014 · 7 comments

Comments

@puzrin
Copy link
Member

puzrin commented Jun 17, 2014

Current cubic2quad convert algorythm is very basic. That does not affect original fonts, but can cause issues, when originals are drawn in SVG. We use stupid midpoint approach with 2 quad curves. It sucks, because we need to keep tangents on edge points.

  1. Approaches:
  2. Error metrict calculation:

Example to reproduce problem (from octicons font):

<svg height="1024" width="1024" xmlns="http://www.w3.org/2000/svg">
  <path d="M768 768H576c0 0-254.281 0-256-256 0-22.281 3.469-43.469 8.312-64h137.405c-11 18.875-17.719 40.562-17.719 64 0 128 128 128 128 128h192c0 0 128 0 128-128S768 384 768 384s-0.125-64-64-128h64c0 0 256 0 256 256S768 768 768 768zM695.688 576H558.25c11-18.875 17.75-40.562 17.75-64 0-128-128-128-128-128H256c0 0-128 0-128 128s128 128 128 128-3.906 64.875 65.719 128H256c0 0-256 0-256-256s256-256 256-256h192c0 0 256 0 256 256C704 534.281 700.5 555.5 695.688 576z" />
</svg>
ilyapro added a commit to ilyapro/svg2ttf that referenced this issue Jul 22, 2014
@Grawl
Copy link

Grawl commented Jun 22, 2015

I have a lot of SVGs (FontAwesome) generated by IcoMoon. I want to pack icon font for my internal company project with some of FontAwesome icons and some own ones. I use gulp-iconfont to do it; linked issues about mangled shapes bring me to this issue. What can I do with all my SVGs to get TTF/WOFF/EOT from they? I cannot just redraw them all. I want to pack them without any changing of these beautiful shapes.

@puzrin
Copy link
Member Author

puzrin commented Jun 22, 2015

What can I do with all my SVGs to get TTF/WOFF/EOT from they?

You can generate svg only, and convert to ttf via fontforge (it can be scripted too)

@Grawl
Copy link

Grawl commented Jun 22, 2015

Awesome.

@lukeapage
Copy link

@puzrin do you have any plans to work on this?

@puzrin
Copy link
Member Author

puzrin commented Aug 5, 2015

Not in nearest future.

@puzrin puzrin closed this as completed in 547eb12 Oct 28, 2015
puzrin pushed a commit that referenced this issue Oct 28, 2015
Fixed smoothness at the ends of interpolated cubic bezier. Close #25
@puzrin
Copy link
Member Author

puzrin commented Nov 2, 2015

Finally fixed in 2.1. Enjoy!

@Grawl
Copy link

Grawl commented Nov 2, 2015

😌

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

3 participants