如何编译MetaFontBook第138页的示例?

如何编译MetaFontBook第138页的示例?

以下是来自 MetaFontBook 的示例:

beginchar ("A", 29mm# , 25mm# , 0); thick# := 2mm#; thin# := 5/4mm#;
define_whole_blacker_pixels(thick , thin);
forsuffixes $ = a, b, c: transform $;
forsuffixes e = l, r: path $e, $'e; numeric t$[]e; endfor endfor
penpos1(thick, 0); penpos2(thick, 90); penpos3(thick, 180); penpos4(thick, 270);
penpos5(thick, 0); penpos6(thick, 90); penpos7(thick, 180); penpos8(thick, 270);
x2 = x4 = x6 = x8 = .5[x5, x7] = .5w; x1r = w; x3r = 0; x5 - x7 = y6 - y8;
y1 = y3 = y5 = y7 = .5[y6, y8] = .5h; y2r = h; y4r = 0; y6r = .75h;
forsuffixes e = l,r: a.e = b'e = c'e = superellipse(z1e, z2e, z3e, z4e, .75);
a'e = b.e = c.e = superellipse (z5e, z6e, z7e, z8e, .72); endfor
penpos.a1(thin, 0); penpos.a5(whatever, -90); penpos.a9(thin, 180);
x.a1l - x.a9l = 1/3(x5l - x7l); x.a5 = .5w; y.a1 = y.a9; y.a5r = 4/7h;
x.a3l = x.a1l; x.a3r = x.a1r; x.a4r = 1/6[x.a3r, x1l]; x0 = .5w; y0 = .52h;
x.a6l + x.a4l = x.a6r + x.a4r = x.a7l + x.a3l = x.a7r + x.a3r = x.a9 + x.a1 = w;
y.a3r = y.a4r = y.a6r = y.a7r = .2[y2l, y0]; y.a3l = y.a4l = y.a6l = y.a7l = y.a3r - thin;
z.a4l = z.a4r + (thin, 0) rotated(angle(z.a4r - z.a5r) + 90)
+ whatever*(z.a4r - z.a5r); z.a4l - z.a5l = whatever*(z.a4r - z.a5r);
z = a.r intersectionpoint (z0 -- (w, 0)); y.a1 - y.a5 = length(z - z0);
b = identity shifted (0, y0 - y.a1) rotatedaround(z0, 90 - angle(z0 - (w, 0)));
c = b reflectedabout (z2, z4);
for n = 1, 3, 4, 5, 6, 7, 9: forsuffixes e = l,,r: forsuffixes $ = b,c:
z.$[n]e = z.a[n]e transformed $; endfor endfor endfor
forsuffixes e = l, r: forsuffixes $ = a, b, c:
z.$2e = $r intersectionpoint (z.$1e -- z.$3e );
z.$8e = $r intersectionpoint (z.$9e -- z.$7e );
t.$1e = xpart($e intersectiontimes(z.$1l -- z.$3l));
t.$9e = xpart($e intersectiontimes(z.$9l -- z.$7l));
t.$4e = xpart($'e intersectiontimes(z.$5r -- z.$4l));
t.$6e = xpart($'e intersectiontimes(z.$5r -- z.$6l)); endfor endfor
penstroke subpath(t.a9e, t.b6e) of a.e;
penstroke subpath(t.b4e, t.c4e) of b'e;
penstroke subpath(t.c6e, t.a1e + 8) of c'e;
penstroke subpath(t.a6e, t.b9e) of a'e;
penstroke subpath(t.b1e, t.c1e) of b.e;
penstroke subpath(t.c9e, t.a4e + 8) of c.e;
forsuffixes $ = a, b, c: penlabels($1, $2, $3, $4, $5, $6, $7, $8, $9);
penstroke z.$2e -- z.$3e -- z.$4e -- z.$5e -- z.$6e -- z.$7e -- z.$8e; endfor
penlabels(range 0 thru 8); endchar;
end

失败并出现以下错误:

This is METAFONT, Version 2.7182818 (TeX Live 2019/dev/Debian) (preloaded base=mf)
(logo.mf
! Value is too large (4775.19102).
l.22 c = b reflectedabout (z2, z4);

? 

为了能够在线显示查看结果,示例中应该做哪些更改?

答案1

模式为 (默认)时尺寸太大proof。在代码开头添加

mode:=canonex;
mode_setup;

或者您想要的任何模式,只要分辨率不是太大;canonex适用于 600dpi。

也可以在命令行上选择模式;如果省略第一行test.mf,则可以调用

mf '\mode=canonex;input test'

mode_setup;非常重要,因为它负责为尖锐的尺寸分配正确的值。

要使用在线显示,请screenchars;在后添加mode_setup;

相关内容