-
Notifications
You must be signed in to change notification settings - Fork 743
Improved Point Type Change From Corner To Curve and From Anything To Tangent #4789
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is in good shape and represents several substantial improvements.
…c cases are marked with comments
Just to be clear: This is not a programming issue; I do not know how to handle this situation at all. Suggestions and hints are welcome! |
@linusromer I just tried a similar shape in what amounts to the current code and the whole contour changes. There seem to be a lot of cases with quadratic splines where there's no good solution and what FontForge does isn't great. (I certainly wouldn't want my whole contour to change as a result of changing one point type.) This is a long-winded way of suggesting that the current solution may actually be fine. I suggest playing around with quadratic splines and the current heuristics to see if you convince yourself of something similar. |
Oh, I guess it is a problem if the control points aren't coincident ... I think it would be fine to leave the current algorithm for quadratics. It would also be fine to adjust the tangent angle to be the average (if that's not what already happens) and then to run the current algorithm. So much changes otherwise that the angle seems like a detail. |
…aks between '}' and 'else', added better behaviour for conversion from tangent to smooth
Indeed, this happens already. I think there exists no proper solution for this problem (e.g. Fontlab struggles with my example contour, too). After thinking a bit I came to the conclusion that it would be best to leave the control points at their original position when this very specific problem occurs (the user has to interact anyway). As far as I have checked, the patch should now be ready for merging. |
…r behaviour for conversion from hvcurve to curve
After commit a0dc9d5 has been pushed, I have tested my patch again and I have discovered and fixed some minor curve updating issues after conversion to |
@linusromer I can look at the remaining problem but a quick set-of-steps-to-reproduce would be handy for me. |
@skef I have made an example font with a contour made of quadratic bezier splines:
|
The "Make Line" problem may be a little above my pay grade, as I'm not sure what the relevant issues are. The problem is that guard in SplineRefigure2 on line 1249 of This may be a simple local/global problem. If you eliminate the control point then you need to renumber all the points. SplineRefigure isn't really the level to try to do that sort of thing. There may also be TTF/quadratic spline font reasons to preserve the numbering. I really don't know much about quadratic spline font production. This seems like something you may just have run across that isn't directly related to your changes here. Is it something we could file an issue about and leave for another time? |
Yes, my example already showed that it has nothing to do with my changes because the two problems were already existant with current Fontforge versions. I just hoped the two problems could be fixed easily and the fix could be packed in this PR. But after your comment I agree that it is wiser to file a separate issue and merge my PR in the current state because it is absolutely independandt. |
For the hvcurve problem: Isn't this just that the code between lines 725 and 745 that handles
|
I just reviewed the code and it looks fine to me. I'll leave it for a few days in case @jtanx or someone else wants to take a look and comment and if not I'll approve it. |
…tly after conversion
@skef Well, yes, this solves the problem. I have added your patch. (Some time ago SplineRefigure() was called anyway at another place but this call was cancelled by a commit in the last year.) |
There were many consistency problems with cubic splines and control points (or lack thereof) before #4685. I wouldn't be surprised to learn that there were related quadratic spline/point numbering problems as well. My guess is that that commit reactivated a consistency check in SplineRefigure2 that wasn't being applied before. MakeLine should probably work in this case, as its changing the geometry so there's no need to preserve TrueType hinting (which depends on point numbering). The problem is that there isn't a consistent way of addressing point numbering in the code, at least that I can see. What's probably needed is a point numbering "philosophy" implemented with a commit similar in scope to #4685. Before that happens the current convention of leaving the point in SplineRefigure2 seems like the lesser of evils. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Improved Point Type Change From Corner To Curve and From Anything To Tangent
This pull request results as an attempt to solve the issue #4763. At the moment, details are explained there. But from now on, I think that changes are better described here. I have tested my code before and after #4685 and while the overall behavior is the same, some things are different (one described at #4787). Therefore, my code may need some revision, when #4787 is solved.
Closes #4763