| 1 |
% Routines for the METAFONT logo, as found in The METAFONTbook |
| 2 |
% Extended to characters P and S for John Hobby's METAPOST |
| 3 |
% (logo10.mf is a typical parameter file) |
| 4 |
|
| 5 |
mode_setup; |
| 6 |
if unknown slant: slant:=0 else: currenttransform:= |
| 7 |
identity slanted slant yscaled aspect_ratio fi; |
| 8 |
|
| 9 |
ygap#:=(ht#/13.5u#)*xgap#; % vertical adjustment |
| 10 |
ho#:=o#; % horizontal overshoot |
| 11 |
leftstemloc#:=2.5u#+s#; % position of left stem |
| 12 |
barheight#:=.45ht#; % height of bar lines |
| 13 |
py#:=.9px#; % vertical pen thickness |
| 14 |
|
| 15 |
define_pixels(s,u); |
| 16 |
define_whole_pixels(xgap); |
| 17 |
define_whole_vertical_pixels(ygap); |
| 18 |
define_blacker_pixels(px,py); |
| 19 |
pickup pencircle xscaled px yscaled py; |
| 20 |
logo_pen:=savepen; |
| 21 |
define_good_x_pixels(leftstemloc); |
| 22 |
define_good_y_pixels(barheight); |
| 23 |
define_corrected_pixels(o); |
| 24 |
define_horizontal_corrected_pixels(ho); |
| 25 |
|
| 26 |
def beginlogochar(expr code, unit_width) = |
| 27 |
beginchar(code,unit_width*u#+2s#,ht#,0); |
| 28 |
pickup logo_pen enddef; |
| 29 |
|
| 30 |
def super_half(suffix i,j,k) = |
| 31 |
draw z.i{0,y.j-y.i} |
| 32 |
... (.8[x.j,x.i],.8[y.i,y.j]){z.j-z.i} |
| 33 |
... z.j{x.k-x.i,0} |
| 34 |
... (.8[x.j,x.k],.8[y.k,y.j]){z.k-z.j} |
| 35 |
... z.k{0,y.k-y.j} enddef; |
| 36 |
|
| 37 |
def super_crescent(suffix i,j,k) = |
| 38 |
draw z.i{x.j-x.i,0} |
| 39 |
... (.8[x.i,x.j],.8[y.j,y.i]){z.j-z.i} |
| 40 |
... z.j{0,y.k-y.i} |
| 41 |
... (.8[x.k,x.j],.8[y.j,y.k]){z.k-z.j} |
| 42 |
... z.k{x.k-x.j,0} enddef; |
| 43 |
|
| 44 |
beginlogochar("M",18); |
| 45 |
x1=x2=leftstemloc; x4=x5=w-x1; x3=w-x3; |
| 46 |
y1=y5; y2=y4; bot y1=-o; |
| 47 |
top y2=h+o; y3=y1+ygap; |
| 48 |
draw z1--z2--z3--z4--z5; |
| 49 |
labels(1,2,3,4,5); endchar; |
| 50 |
|
| 51 |
beginlogochar("E",14); |
| 52 |
x1=x2=x3=leftstemloc; |
| 53 |
x4=x6=w-x1+ho; x5=x4-xgap; |
| 54 |
y1=y6; y2=y5; y3=y4; |
| 55 |
bot y1=0; top y3=h; y2=barheight; |
| 56 |
draw z6--z1--z3--z4; draw z2--z5; |
| 57 |
labels(1,2,3,4,5,6); endchar; |
| 58 |
|
| 59 |
beginlogochar("T",13); |
| 60 |
italcorr ht#*slant + .5u#; |
| 61 |
if .5w<>good.x .5w: change_width; fi |
| 62 |
lft x1=-eps; x2=w-x1; x3=x4=.5w; |
| 63 |
y1=y2=y3; top y1=h; bot y4=-o; |
| 64 |
draw z1--z2; draw z3--z4; |
| 65 |
labels(1,2,3,4); endchar; |
| 66 |
|
| 67 |
beginlogochar("A",15); |
| 68 |
x1=.5w; x2=x4=leftstemloc; x3=x5=w-x2; |
| 69 |
top y1=h+o; y2=y3=barheight; |
| 70 |
bot y4=bot y5=-o; |
| 71 |
draw z4--z2--z3--z5; super_half(2,1,3); |
| 72 |
labels(1,2,3,4,5); endchar; |
| 73 |
|
| 74 |
beginlogochar("F",14); |
| 75 |
x1=x2=x3=leftstemloc; |
| 76 |
x4=w-x1+ho; x5=x4-xgap; |
| 77 |
y2=y5; y3=y4; bot y1=-o; |
| 78 |
top y3=h; y2=barheight; |
| 79 |
draw z1--z3--z4; draw z2--z5; |
| 80 |
labels(1,2,3,4,5); endchar; |
| 81 |
|
| 82 |
beginlogochar("P",14); |
| 83 |
x1=x2=x3=leftstemloc; |
| 84 |
x4=x5=.618[x1,w-x1]; |
| 85 |
y2=y5; y3=y4; bot y1=-o; |
| 86 |
top y3=h; y2=barheight; |
| 87 |
draw z1--z3--z4; draw z2--z5; |
| 88 |
x6=.5[w-x1,lft w]; y6=.5[y4,y5]; |
| 89 |
super_crescent(4,6,5); |
| 90 |
labels(1,2,3,4,5,6); endchar; |
| 91 |
|
| 92 |
beginlogochar("S",14); |
| 93 |
x3=x8=leftstemloc; |
| 94 |
x1=w-x3; |
| 95 |
x2=x4=.382[x3,x1]; |
| 96 |
x5=x7=.9[x3,x1]; |
| 97 |
x6=.5[x1,w]; |
| 98 |
top y1=h; y4=barheight; bot y8=0; |
| 99 |
y1=y2; y3=.6[y2,y4]; y4=y5; y6=.3[y5,y7]; y7=y8; |
| 100 |
draw z1--z2; draw z4--z5; draw z7--z8; |
| 101 |
super_crescent(2,3,4); |
| 102 |
super_crescent(5,6,7); |
| 103 |
labels(1,2,3,4,5,6,7,8); endchar; |
| 104 |
|
| 105 |
beginlogochar("O",15); |
| 106 |
x1=x4=.5w; top y1=h+o; bot y4=-o; |
| 107 |
x2=w-x3=good.x(1.5u+s); y2=y3=barheight; |
| 108 |
super_half(2,1,3); super_half(2,4,3); |
| 109 |
labels(1,2,3,4); endchar; |
| 110 |
|
| 111 |
beginlogochar("N",15); |
| 112 |
x1=x2=leftstemloc; x3=x4=x5=w-x1; |
| 113 |
bot y1=bot y4=-o; |
| 114 |
top y2=top y5=h+o; y3=y4+ygap; |
| 115 |
draw z1--z2--z3; draw z4--z5; |
| 116 |
labels(1,2,3,4,5); endchar; |
| 117 |
|
| 118 |
ligtable "T": "A" kern -.5u#; |
| 119 |
ligtable "F": "O" kern -u#; |
| 120 |
ligtable "P": "O" kern u#; |
| 121 |
|
| 122 |
font_quad:=18u#+2s#; |
| 123 |
font_normal_space:=6u#+2s#; |
| 124 |
font_normal_stretch:=3u#; |
| 125 |
font_normal_shrink:=2u#; |
| 126 |
font_identifier:="MFLOGO" if slant<>0: & "SL" fi; |
| 127 |
font_coding_scheme:="AEFMNOPST only"; |