From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- support/proof/example.mf | 141 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 support/proof/example.mf (limited to 'support/proof/example.mf') diff --git a/support/proof/example.mf b/support/proof/example.mf new file mode 100644 index 0000000000..de7194c990 --- /dev/null +++ b/support/proof/example.mf @@ -0,0 +1,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 + -- cgit v1.2.3