summaryrefslogtreecommitdiff
path: root/support/proof/example.mf
blob: de7194c990c8fa9e14a1969bed409d43728c6d0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
% Sample METAFONT sourcefile ()

% Routines for the METAFONT logo, as found in The METAFONTbook
% Extended to characters P and S for John Hobby's METAPOST

% 10-point METAFONT logo
font_size 10pt#;  % the "design size" of this font
ht#:=6pt#;        % height of characters
xgap#:=0.6pt#;    % horizontal adjustment
u#:=4/9pt#;       % unit width
s#:=0;            % extra space at the left and the right
o#:=1/9pt#;       % overshoot
px#:=2/3pt#;      % horizontal thickness of pen


mode_setup;
if unknown slant: slant:=0 else: currenttransform:=
 identity slanted slant yscaled aspect_ratio fi;

ygap#:=(ht#/13.5u#)*xgap#;              % vertical adjustment
ho#:=o#;                                % horizontal overshoot
leftstemloc#:=2.5u#+s#;                 % position of left stem
barheight#:=.45ht#;                     % height of bar lines
py#:=.9px#;                             % vertical pen thickness

define_pixels(s,u);
define_whole_pixels(xgap);
define_whole_vertical_pixels(ygap);
define_blacker_pixels(px,py);
pickup pencircle xscaled px yscaled py;
logo_pen:=savepen;
define_good_x_pixels(leftstemloc);
define_good_y_pixels(barheight);
define_corrected_pixels(o);
define_horizontal_corrected_pixels(ho);

def beginlogochar(expr code, unit_width) =
 beginchar(code,unit_width*u#+2s#,ht#,0);
 pickup logo_pen enddef;

def super_half(suffix i,j,k) =
 draw z.i{0,y.j-y.i}
 ... (.8[x.j,x.i],.8[y.i,y.j]){z.j-z.i}
 ... z.j{x.k-x.i,0}
 ... (.8[x.j,x.k],.8[y.k,y.j]){z.k-z.j}
 ... z.k{0,y.k-y.j} enddef;

def super_crescent(suffix i,j,k) =
 draw z.i{x.j-x.i,0}
 ... (.8[x.i,x.j],.8[y.j,y.i]){z.j-z.i}
 ... z.j{0,y.k-y.i}
 ... (.8[x.k,x.j],.8[y.j,y.k]){z.k-z.j}
 ... z.k{x.k-x.j,0} enddef;

beginlogochar("M",18);
x1=x2=leftstemloc; x4=x5=w-x1; x3=w-x3;
y1=y5; y2=y4; bot y1=-o;
top y2=h+o; y3=y1+ygap;
draw z1--z2--z3--z4--z5;
labels(1,2,3,4,5); endchar;

beginlogochar("E",14);
x1=x2=x3=leftstemloc;
x4=x6=w-x1+ho; x5=x4-xgap;
y1=y6; y2=y5; y3=y4;
bot y1=0; top y3=h; y2=barheight;
draw z6--z1--z3--z4; draw z2--z5;
labels(1,2,3,4,5,6); endchar;

beginlogochar("T",13);
italcorr ht#*slant + .5u#;
if .5w<>good.x .5w: change_width; fi
lft x1=-eps; x2=w-x1; x3=x4=.5w;
y1=y2=y3; top y1=h; bot y4=-o;
draw z1--z2; draw z3--z4;
labels(1,2,3,4); endchar;

beginlogochar("A",15);
x1=.5w; x2=x4=leftstemloc; x3=x5=w-x2;
top y1=h+o; y2=y3=barheight;
bot y4=bot y5=-o;
draw z4--z2--z3--z5; super_half(2,1,3);
labels(1,2,3,4,5); endchar;

beginlogochar("F",14);
x1=x2=x3=leftstemloc;
x4=w-x1+ho; x5=x4-xgap;
y2=y5; y3=y4; bot y1=-o;
top y3=h; y2=barheight;
draw z1--z3--z4; draw z2--z5;
labels(1,2,3,4,5); endchar;

beginlogochar("P",14);
x1=x2=x3=leftstemloc;
x4=x5=.618[x1,w-x1];
y2=y5; y3=y4; bot y1=-o;
top y3=h; y2=barheight;
draw z1--z3--z4; draw z2--z5;
x6=.5[w-x1,lft w]; y6=.5[y4,y5];
super_crescent(4,6,5);
labels(1,2,3,4,5,6); endchar;

beginlogochar("S",14);
x3=x8=leftstemloc;
x1=w-x3;
x2=x4=.382[x3,x1];
x5=x7=.9[x3,x1];
x6=.5[x1,w];
top y1=h; y4=barheight; bot y8=0;
y1=y2; y3=.6[y2,y4]; y4=y5; y6=.3[y5,y7]; y7=y8;
draw z1--z2; draw z4--z5; draw z7--z8;
super_crescent(2,3,4);
super_crescent(5,6,7);
labels(1,2,3,4,5,6,7,8); endchar;

beginlogochar("O",15);
x1=x4=.5w; top y1=h+o; bot y4=-o;
x2=w-x3=good.x(1.5u+s); y2=y3=barheight;
super_half(2,1,3); super_half(2,4,3);
labels(1,2,3,4); endchar;

beginlogochar("N",15);
x1=x2=leftstemloc; x3=x4=x5=w-x1;
bot y1=bot y4=-o;
top y2=top y5=h+o; y3=y4+ygap;
draw z1--z2--z3; draw z4--z5;
labels(1,2,3,4,5); endchar;

ligtable "T": "A" kern -.5u#;
ligtable "F": "O" kern -u#;
ligtable "P": "O" kern u#;

font_quad:=18u#+2s#;
font_normal_space:=6u#+2s#;
font_normal_stretch:=3u#;
font_normal_shrink:=2u#;
font_identifier:="MFLOGO" if slant<>0: & "SL" fi;
font_coding_scheme:="AEFMNOPST only";

bye