[tex-k] mf.ch Issue
Tim Stadelmann
mail at timstadelmann.de
Fri Aug 6 00:42:06 CEST 2021
Dear all,
I’ve stumbled across a minor issue with the mf.ch change file distributed with web2c.
The following change, which can be found at line 1096 in SVN revision 57629 of the file, is apparently intended to avoid long arguments to make_fraction and take_fraction. However, it also changes the value of alpha, as only the calculation of the first term of the difference is simplified - the second term is missing:
% [25.530] |make_fraction| and |take_fraction| arguments are too long for
% some preprocessors, when they were defined as macros, just as in the
% previous change.
@x
alpha:=take_fraction(take_fraction(major_axis,
make_fraction(gamma,beta)),n_cos)@|
-take_fraction(take_fraction(minor_axis,
make_fraction(delta,beta)),n_sin);
alpha:=(alpha+half_unit) div unity;
gamma:=pyth_add(take_fraction(major_axis,n_cos),
take_fraction(minor_axis,n_sin));
@y
alpha := make_fraction (gamma, beta);
alpha := take_fraction (major_axis, alpha);
alpha := take_fraction (alpha, n_cos);
alpha := (alpha+half_unit) div unity;
gamma := take_fraction (minor_axis, n_sin);
gamma := pyth_add (take_fraction (major_axis, n_cos), gamma);
@z
I suspect this is not intentional. Because of the way alpha is used in the algorithm, the effect on the calculated pen polygon is actually quite small. However, for some inputs subtly different pens are generated. This effect can be seen in the attached minimal example, input.mf. Instead of the expected pen given in the log file expected.log, a copy of mf compiled using the distributed mf.ch calculates the pen given in the log file actual.log. It differs from the expected pen by half a pixel in two locations.
The actual.log output was created on an Intel Mac (MacOS 11.5) by the mf program currently provided with TeX Live 2021. The expected.log was created on the same system by the same version of the program (SVN revision 60172) compiled by Apple clang 12.0.5 without applying the discussed change.
Best regards,
Tim Stadelmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: input.mf
Type: application/octet-stream
Size: 72 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-k/attachments/20210806/1d54722e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: actual.log
Type: application/octet-stream
Size: 500 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-k/attachments/20210806/1d54722e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: expected.log
Type: application/octet-stream
Size: 496 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-k/attachments/20210806/1d54722e/attachment-0002.obj>
More information about the tex-k
mailing list.