“平滑”笔触交叉点

“平滑”笔触交叉点

我正在尝试在 METAPOST 和/或 METAFONT 中设计一种字体。更具体地说,我正在尝试使用 METAPOST 来“数字化”一种特定的字体以模拟其形状。我的目标是使用尽可能自然的习语,并允许 Computer Modern 式的可调性。然而,我注意到有些东西(就我所知)很难表达。例如,这是一个小写字母“h”:

在此处输入图片描述

笔触是蓝白相间的(显然是不完整的),原始形状用一条细黑线显示。您会注意到,蓝色笔触与红色笔触非常清晰地交汇,与原始形状截然不同。有没有一种相当自然的习语来处理这个问题?显然,有 METAPOST 代码可以执行布尔运算符。那么,我可以将蓝色和红色路径合并并平滑所有边缘吗?或者这样的事情根本不可能?如果不是这样,那么实现我想要的效果的最佳方法是什么(除了使用贝塞尔曲线,因为我希望能够重用代码)。

这是METAPOST代码:

prologues := 3;
outputformat:="eps";
outputtemplate:="%j.eps";

beginfig(1)

z1=(123,670);
z2=(117,25);
z3=(125,333);
z4=(365,340);
z5=(406,25);

pickup pencircle scaled 70 yscaled .55 rotated 0;
draw z1 .. z2 withcolor 0.3[red,white];

pickup pencircle scaled 80 yscaled .46 rotated 30;
draw z3{dir 45} .. z4{dir -60} .. {dir -90}z5 withcolor 0.4[blue,white];

pickup pencircle scaled 0.5;

draw (293,8)
-- (293,15)
..controls (293, 36) and (306, 32) .. (350, 38)
..controls (370, 41) and (370, 49) .. (370,125)
..controls (370,269) and (347,308) .. (322,335)
..controls (302,355) and (273,371) .. (241,371)
..controls (198,371) and (159,342) .. (154,322)
..controls (153,318) and (153,314) .. (153,309)
..controls (153,303) and (153, 69) .. (155, 62)
..controls (163, 19) and (230, 51) .. (230, 15)
..controls (230,  6) and (228, -6) .. (219, -6)
..controls (216, -6) and (176,  0) .. (127,  0)
..controls (76 ,  0) and ( 36, -6) .. ( 33, -6)
..controls (21 , -6) and ( 21,  5) .. ( 21, 14)
..controls (21 , 31) and ( 30, 30) .. ( 58, 36)
..controls (81 , 40) and ( 81, 56) .. ( 82, 70)
..controls (85 ,161) and ( 87,253) .. ( 87,345)
-- (87,349)
..controls (87 ,430) and ( 84,588) .. ( 83,594)
..controls (78 ,619) and ( 12,610) .. ( 12,636)
..controls (12 ,648) and ( 26,654) .. ( 28,655)
..controls (135,717) and (136,719) .. (143,719)
-- (144,719)
..controls (150,719) and (159,716) .. (159,700)
-- (158,392)
..controls (158,386) and (161,385) .. (163,385)
..controls (169,385) and (213,422) .. (281,422)
..controls (347,422) and (392,384) .. (415,331)
..controls (435,284) and (440,253) .. (444, 66)
..controls (444, 38) and (456, 37) .. (481, 34)
..controls (489, 33) and (498, 30) .. (498, 16)
..controls (498, -2) and (493, -6) .. (485, -6)
..controls (482, -6) and (444,  0) .. (394,  0)
..controls (346,  0) and (307, -6) .. (304, -6)
..controls (295, -6) and (293,  1) .. cycle;

endfig;

end

相关内容