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

Remove overlaps guesses wrong about inside and outside #473

Closed
ghost opened this issue Mar 22, 2013 · 5 comments
Closed

Remove overlaps guesses wrong about inside and outside #473

ghost opened this issue Mar 22, 2013 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 22, 2013

  1. Load the file from https://github.com/fontforge/debugfonts/blob/master/rmo-we.sfd
  2. Select the one glyph it contains
  3. Remove overlaps

This glyph is a single stroke that bounces around a bit and forms a loop. Removing overlaps fills in the counter of the loop and destroys everything else. The bug seems to be similar in nature to #402, but it's to do with guessing wrong about which curves are "inside" and which are "outside" rather than deleting control points, so I'm filing it separately.

@ultrasquid
Copy link

There is something weird going on here that I can't quite explain. I can confirm the erroneous behavior, but when I add extrema and simplify before removing overlaps, overlaps are removed in the expected way. Still, though those additional steps are part of my routine, they shouldn't be necessary to avoid this error.

@ghost
Copy link
Author

ghost commented Mar 22, 2013

It's often been my experience that varying the order and combinations of add extrema, simplify, remove overlaps, rounding, and find intersections will fix this kind of problem for any given glyph. However, then other glyphs break. I've yet to find a sequence that reliably works for all glyphs.

@ultrasquid
Copy link

It is the sort of thing you have to do one glyph at a time. If you try to
hit a whole font all at once, problems are bound to turn up.
Certainly there could be room to improve the code for these functions to
prevent those problems, but I couldn't tell you what.

On Fri, Mar 22, 2013 at 3:57 PM, Matthew Skala notifications@github.comwrote:

It's often been my experience that varying the order and combinations of
add extrema, simplify, remove overlaps, rounding, and find intersections
will fix this kind of problem for any given glyph. However, then other
glyphs break. I've yet to find a sequence that reliably works for _all_glyphs.


Reply to this email directly or view it on GitHubhttps://github.com//issues/473#issuecomment-15325564
.

Jason Pagura
zimbach at gmail dot com

@frank-trampe
Copy link
Contributor

This isn't directly about guessing wrong about inside and outside. There were several problems in the overlap removal code.

One problem was assuming in certain places that two intersections were identical (due to rounding) but assuming them to be non-identical due to different intersection objects with slightly different coordinates being present.

The other problem caused a segment being divided to fail to connect to an intersection at its end correctly. (The first segment would remain connected to the end even after being replaced by the second segment on that side of the division.)

Pull request #1485 addresses both of these issues.

@frank-trampe
Copy link
Contributor

Closed by #1485.

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

No branches or pull requests

2 participants