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

Fixing "Wrong Direction" reverses direction back to counter-clockwise in some cases #3962

Open
ghost opened this issue Oct 4, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 4, 2019

Hi,

Unfortunately FontForge crashes a lot for unknown reasons. But this time I found a reproducible bug. FontForge's ability to fix a problem actually creates a problem.

Steps to reproduce:

  • Draw a shape in counter-clockwise direction.
  • Click "File" > "Generate Fonts...".
  • Let the software "Validate Before Saving".
  • Click "Review" the detected errors.
  • Click on the validation error to see the affected glyph.
  • Don't click "Fix" button.
  • Fix the direction using "Element" > "Correct Direction".
  • Now click "Fix" button.

Expected result:

  • The direction should stay clockwise.

Actual result:

  • The direction is reversed back to counter-clockwise.
  • You have to click the "Fix" button once again to actually fix the problem.

Reproducible: Always

Version: Custom build git-cloned master branch
Environment: Linux Debian Stretch

While this is a minor bug, fixing it may lead to a better and cleaner codebase.

@ghost ghost changed the title Fixing "Wrong Direction" reverses direction Fixing "Wrong Direction" reverses direction back to counter-clockwise in some cases Oct 4, 2019
@frank-trampe
Copy link
Contributor

The problem-fixing codepath has a lot of actual problems (like caching pointers and trying to use them after they are invalidated). This one does not strike me as among the highest priorities there. If the user wants to fix the direction, he can click the fix button or correct the direction himself rather than doing both. The only "solution" that comes to mind would be to revalidate each glyph before applying a commanded fix, and that might bring with it its own set of problems.

@ghost
Copy link
Author

ghost commented Oct 4, 2019

I thought fixing it was as easy as changing one line with another. Like replace "InvertDirection" with "CorrectDirection".

If it's difficult, yeah, probably you have other things to fix first.

@frank-trampe
Copy link
Contributor

The underlying function is SplineSetsCorrect. Maybe take a look and see what side effects it has. I'll have a chance to look at it later today.

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

1 participant