thiagoharry / weaver-interface-metafont

A METAFONT Submodule for Weaver Game Engine
GNU Affero General Public License v3.0
0 stars 0 forks source link

Producing different control points than expected from original METAFONT #1

Closed thiagoharry closed 6 months ago

thiagoharry commented 6 months ago

While most tests are producing results similar to original METAFONT, the following code fragment produces mismatching control points:

(4, 3) .. (2, 3) .. {-2, -1}(3, 3)

The first segment produces control points (16.487888, -2.922737) and (-10.487888 -2.922737) while in the original METAFONT the produced control points are (11.22821, -0.42822) and (-5.22821, -0.42822). The second segment produces the same control points. The following screenshot shows the two paths (the expected one and the produced one) together, moved 2 pixels to the right and scaled 100x to compare the differences. The horizontal line is the baseline:

Screenshot from 2024-02-25 09-31-58

The reason for the mismatch is still not known. The other paths from out test file produces correct results. Trying to compute the values manually gave me the produced path, not the expected one. Perhaps I overlooked something or interpreted incorrectly some corner case about how control points are produced? Or did I found some strange case where METAFONT produces an output with a much greater error than expected? As I am leaving this error for now, I will at least let it documented here.

thiagoharry commented 6 months ago

Investigation of the issue in: bug.pdf

Conclusion: Weaver Metafont computes the value with more precision. The original METAFONT produced an error of about 35%. The issue will be closed, as this means that it is not caused by some bug in Weaver Metafont.

EDIT: The PDF have a typo. The final value for 'v' is '−10.4878888 -2.9227371i', which agrees with the above conclusion.