This is a improvement request. When using "Merge" in FontForge, the resulting merged curve is quite inaccurate in many cases.
The following image shall illustrate this inaccurateness:

If several segments are to be merged, FontForge's algorithm (right) is even worse in comparison with my algorithm (left): (only the upper right segments have been merged)

I think splinefit.c and the ApproximateSplineFromPoint* methods are responsible for "Merge".
The main problem of FontForge's algorithm IMHO is the assumption that the point at time t of the approximation contour is near the point at time t of the original contour. But because FontForge's contour are not parameterized by arc length, this assumption is bad.
If you want you may use my algorithm: I have varied the handle lengths until the error of the approximation contour has become minimal. The error is calculated as follows:
- calculate few (9) points inbetween the start and the end point of the original contour
- calculate more (99) points inbetween the start and the end point of the approximation contour
- for each of the original 9 points find the smallest squared distance to the 99 points; the sum of the squared distances is the error
I have made a quick Python plugin to test the algorithm. It seems to work okay (only the User Interface function is bad).
Example font and Python plugin in mergebezier.zip
(I have updated the plugin because I had implemented a small part which made the error calculation faster but worse in some situations. Now it really should follow the description that is already given here.)
This is a improvement request. When using "Merge" in FontForge, the resulting merged curve is quite inaccurate in many cases.


The following image shall illustrate this inaccurateness:
If several segments are to be merged, FontForge's algorithm (right) is even worse in comparison with my algorithm (left): (only the upper right segments have been merged)
I think splinefit.c and the ApproximateSplineFromPoint* methods are responsible for "Merge".
The main problem of FontForge's algorithm IMHO is the assumption that the point at time t of the approximation contour is near the point at time t of the original contour. But because FontForge's contour are not parameterized by arc length, this assumption is bad.
If you want you may use my algorithm: I have varied the handle lengths until the error of the approximation contour has become minimal. The error is calculated as follows:
I have made a quick Python plugin to test the algorithm. It seems to work okay (only the User Interface function is bad).
Example font and Python plugin in mergebezier.zip
(I have updated the plugin because I had implemented a small part which made the error calculation faster but worse in some situations. Now it really should follow the description that is already given here.)