Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/fonts/source/public/misc/manfnt.mf

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


% Special font for the TeX and METAFONT manuals
% This file was prepared "hastily" and hasn't been "polished".
% In particular, some characters won't work when aspect_ratio<>1.

font_size 10pt#;
em#:=10pt#; ht#:=250/36pt#;
mode_setup;

font_identifier "MANFNT";
font_coding_scheme "PI";

message "Hex symbols";
width1#=.4pt#*(ht#/(100/36pt#));
width2#=.6pt#*(ht#/(100/36pt#));
define_blacker_pixels(width1,width2);

beginchar(1,2ht#,ht#,0); "Original hex";  % \hexa
pickup pencircle scaled width1;
w:=2good.x .5w;
x1=x4=good.x 0; x2=x5=.5w; x3=x6=good.x w;
y1=y2=y3=good.y h; y4=y5=y6=good.y 0;
draw z1..z6; draw z2..z5; draw z3..z4;
for k=1 upto 6: drawdot z[k]; endfor
labels (1,2,3,4,5,6); endchar;

beginchar(2,2ht#,ht#,0); "Top/bot adjusted hex";  % \hexb
pickup pencircle scaled width1;
w:=2good.x .5w;
x1=x4=good.x 0; x2=x5=.5w; x3=x6=good.x w;
top y1=h; y1=y2=y3; bot y4=0; y4=y5=y6;
draw z1..z6; draw z2..z5; draw z3..z4;
for k=1 upto 6: drawdot z[k]; endfor
labels (1,2,3,4,5,6); endchar;

beginchar(3,2ht#,ht#,0); "Bold top/bot adjusted hex";  % \hexc
pickup pencircle scaled width2;
w:=2good.x .5w;
x1=x4=good.x 0; x2=x5=.5w; x3=x6=good.x w;
top y1=h; y1=y2=y3; bot y4=0; y4=y5=y6;
draw z1..z6; draw z2..z5; draw z3..z4;
for k=1 upto 6: drawdot z[k]; endfor
labels (1,2,3,4,5,6); endchar;

beginchar(4,2ht#,ht#,0); "Bold top/bot/lft/rt adjusted hex";  % \hexd
pickup pencircle scaled width2;
w:=2good.x .5w;
lft x1=0; x1=x4; x2=x5=.5w; rt x3=w-1; x3=x6;
top y1=h; y1=y2=y3; bot y4=0; y4=y5=y6;
draw z1..z6; draw z2..z5; draw z3..z4;
for k=1 upto 6: drawdot z[k]; endfor
labels (1,2,3,4,5,6); endchar;

beginchar(5,2ht#,ht#,0); "Hex corrected for darkness in the center"; % \hexe
pickup pencircle scaled width1;
w:=2good.x .5w;
top z1=(0,h); top z2=(.5w,h); top z3=(w,h);
bot z4=(0,0); bot z5=(.5w,0); bot z6=(w,0);
for k=1 upto 6: drawdot z[k]; endfor
z1'=.25[z1,z6]; z6'=.75[z1,z6]; theta1:=angle(z6-z1)+90;
z3'=.25[z3,z4]; z4'=.75[z3,z4]; theta3:=angle(z4-z3)+90;
z7=z8=.5[z1,z6];
penpos1'(width1,theta1); penpos6'(width1,theta1); penpos7(.6width1,theta1);
penpos3'(width1,theta3); penpos4'(width1,theta3); penpos8(.6width1,theta3);
draw z1..z1'; penstroke z1'e{z6'-z1'}..z7e..{z6'-z1'}z6'e; draw z6'..z6;
draw z2..z5;
draw z3..z3'; penstroke z3'e{z4'-z3'}..z8e..{z4'-z3'}z4'e; draw z4'..z4;
penlabels(1,1',7,2,3,3',8,4,4',5,6,6'); endchar;

message "Stick A's";
b#:=250/36pt#; a#:=150/36pt#; s#:=30/36pt#;
standardwidth#:=.4pt#;
darkwidth#:=.8pt#; lightwidth#:=.2pt#;
define_blacker_pixels(standardwidth,darkwidth,lightwidth);
define_pixels(b,a,s);
def stick_A(expr alpha)(text pentype)=
beginchar (incr(charcode),s#+a#+s#,b#,0);
pickup pentype;
bot z1=(good.x s,0); z5=z1+(a,0);
z3=(1/2[x1,x5],good.y b);
z2=alpha[z1,z3]; z4=alpha[z5,z3];
draw z1..z3; draw z3..z5; draw z2..z4;
drawdot z1; drawdot z5; drawdot z3;
labels(1,2,3,4,5); endchar; enddef;
charcode:=5; % the first A will be number 6

stick_A((3-sqrt5)/2, % (area above bar / area below) = golden ratio % \Aa
 pencircle scaled standardwidth);

for alpha=.2 step .05 until .5+10epsilon:
 stick_A(alpha,pencircle scaled standardwidth); endfor % chars 7..13

beginchar(14,s#+a#+s#,b#,0);
pickup pencircle scaled standardwidth;
bot z1=(good.x s,0); z5=z1+(a,0);
z3=(1/2[x1,x5],good.y b);
z4-z2=whatever*dir20; 1/2[y2,y4]=2/3[y3,y1];
z2=whatever[z1,z3]; z4=whatever[z3,z5];
draw z1..z3; draw z3..z5; draw z2..z4;
drawdot z1; drawdot z5; drawdot z3;
labels(1,2,3,4,5); endchar;

stick_A((3-sqrt5)/2,pencircle xscaled darkwidth yscaled lightwidth); % \Ab=15
stick_A((3-sqrt5)/2,
 pencircle xscaled darkwidth yscaled lightwidth rotated 30); % \Ac=16

message "Kidney beans";
standardwidth#:=.4pt#;
darkwidth#:=.8pt#; lightwidth#:=.2pt#;
define_blacker_pixels(standardwidth,darkwidth,lightwidth);
b#:=100/36pt#;
define_pixels(b);
def bean(text pentype)=
beginchar (incr(charcode),2b#,1.5b#,0);
pickup pentype;
z1=(0,b); z2=(b,b); z3=(2b,b);
z4=(0,0); z5=(b,0); z6=(2b,0);
draw z5..z4..z1..z3..z6..cycle;
labels(1,2,3,4,5,6); endchar; enddef;
charcode:=16; % the first bean will be number 17

bean(pencircle scaled standardwidth);  % \beana=17
bean(pencircle scaled darkwidth);  % \beanb=18
bean(pencircle xscaled darkwidth yscaled lightwidth); % \beanc=19
bean(pencircle xscaled darkwidth yscaled lightwidth rotated 30); % \beand=20

message "Pen nibs";
bigthickwidth#:=8pt#; littlethickwidth#:=2pt#;
define_blacker_pixels(bigthickwidth,littlethickwidth);

beginchar(21,bigthickwidth#,0,0);  % \niba
pickup pencircle xscaled bigthickwidth yscaled littlethickwidth;
lft z1=(0,good.y 0);
drawdot z1;
labels(1); endchar;

beginchar(22,bigthickwidth#,0,0);  % \nibb
pickup pencircle xscaled bigthickwidth yscaled littlethickwidth rotated 30;
lft z1=(0,good.y 0);
drawdot z1;
labels(1); endchar;

beginchar(23,littlethickwidth#,0,0);  % \nibc
pickup pencircle yscaled bigthickwidth xscaled littlethickwidth;
lft z1=(0,good.y 0);
drawdot z1;
labels(1); endchar;

message "Ionian letters";
em#:=10pt#; cap#:=7pt#;
thin#:=1/3pt#; thick#:=5/6pt#;
slab#:=.8pt#;
stem#:=.9pt#;
o#:=1/5pt#;

define_pixels(em,cap);
define_blacker_pixels(thin,thick,slab,stem);
define_corrected_pixels(o);

curve_sidebar=round 1/18em;

%vardef pentaper@#(expr lt,rt) = % dropped from PLAIN
% x@#l:=lt[x@#l,x@#]; x@#r:=rt[x@#r,x@#];
% y@#l:=lt[y@#l,y@#]; y@#r:=rt[y@#r,y@#] enddef;


% ill-fated example wasn't attractive enough by itself:
%bar:=slab;
%beginchar(24,0.6em#,cap#,0); % "The letter T"; \IOT=24
%penpos1(bar,70);
%penpos2(bar,35);
%penpos4(bar,35);
%penpos5(bar,55);
%x1=0; y1r=h; y2r=y4r=.2[y1r,y1]; y5l=.3[y1l,y1];
%x2l=1/3[x1l,x5l]; x4l=2/3[x1l,x5l]; x5=w;
%penpos6(stem,20); pentaper6(.1,0);
%penpos3(x6r-x6l,0);
%penpos7(stem,10);
%y3=y2; x3=.5w;
%x6r=x3r; y6=2/3h;
%x7=x6; y7=0;
%penstroke z1e{curl infinity}..z2e..z4e..{curl infinity}z5e;
%penstroke z3e..z6e{down}..z7e;
%labels.top(1r,2l,2,2r,4l,4,4r,6);
%labels.lft(1,1l,6l);
%labels.rt(5,5r,5l,6r);
%labels.bot(3l,3,3r,7,7r,7l);
%endchar;

beginchar(25,5/9em#,cap#,0); % "The letter S"; /IOS=25
penpos1(slab,70);
penpos2(.5slab,80);
penpos3(.5[slab,thick],200);
penpos5(.5[slab,thick],210);
penpos6(.7slab,80);
penpos7(.25[slab,thick],72);
x1=x5; y1r=.94h+o;
x2=x4=x6=.5w; y2r=h+o; y4=.54h; y6l=-o;
x3r=.04em; y3=.5[y4,y2];
x5l=w-.03em; y5=.5[y4,y6];
.5[x7l,x7]=.04em; y7l=.12h-o;
path trial; trial=z3{down}..z4..{down}z5;
pair dz; dz=direction 1 of trial;
penpos4(thick,angle dz-90);
penstroke z1e..z2e{left}..z3e{down}..z4e{dz}..z5e{down}..z6e{left}..z7e;
labels.lft(2,3r,5r,6,7);
labels.rt(1,3l,4,5l);
labels.top(1r,2r,3,4l,5,6r,7r);
labels.bot(1l,2l,4r,6l,7l);
endchar;

beginchar(26,0.8em#,cap#,0); % "The letter O"; \IOO=26
 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
 penpos3(thick,180+10); penpos4(thin,270-10);
 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
 penstroke z1e{down}..z2e{right}..z3e{up}..z4e{left}..cycle;
 penlabels(1,2,3,4); endchar;

beginchar(27,.35em#,cap#,0); % "The letter I"; \IOI=27
 penpos1(stem,15); penpos2(.9stem,12); penpos3(stem,10);
 x1=x2=x3=.5w; y1=h; y2=.55h; y3=0; x2l:=1/6[x2l,x2];
 penstroke z1e..z2e{down}..z3e;
 penlabels(1,2,3); endchar;

%ligtable 24: 24 kern .05em#, 26 kern -.05em#; % TT and TO are adjusted

message "Cubes and such";
s#:=5pt#; define_pixels(s); % side of the square
beginchar(28,5/3s#,4/3s#,0); % "Possible cube"; \cubea=28
z1=(-epsilon,-epsilon);  z2=(s+epsilon,-epsilon);
  z3=(-epsilon,s+epsilon); z4=(s+epsilon,s+epsilon);
for k=1 upto 4: z[k+4]=z[k]+(2/3s,1/3s); endfor
pickup pencircle scaled .4pt;
draw z5--z6--z8--z7--cycle;
pickup pencircle scaled 1.6pt;
erase draw z2--z4--z3;
pickup pencircle scaled .4pt;
draw z1--z2--z4--z3--cycle;
for k=1 upto 4:  draw z[k]--z[k+4]; endfor
labels.top(1,2,5,6);
labels.bot(3,4,7,8);
endchar;

beginchar(29,5/3s#,4/3s#,0); % "Impossible cube"; \cubeb=29
z1=(-epsilon,-epsilon);  z2=(s+epsilon,-epsilon);
  z3=(-epsilon,s+epsilon); z4=(s+epsilon,s+epsilon);
for k=1 upto 4: z[k+4]=z[k]+(2/3s,1/3s); endfor
pickup pencircle scaled .4pt;
draw z3--z4; draw z5--z6;
cullit; pickup pencircle scaled 1.6pt;
undraw z7--1/2[z7,z5];
 undraw z2--1/2[z2,z4];
cullit; pickup pencircle scaled .4pt;
draw z3--z1--z2--z4;
 draw z5--z7--z8--z6;
for k=1 upto 4:  draw z[k]--z[k+4]; endfor
labels.top(1,2,5,6);
labels.bot(3,4,7,8);
endchar;

beginchar(30,10pt#,7pt#,2pt#); % bicentennial star
pair center; center=(.5w,2pt);
numeric radius; radius=5pt;
for k=0 upto 4: z[k]=center+(radius,0) rotated(90+360/5k); endfor
def :: = ..tension 5.. enddef;
path star; star=z0::z2::z4::z1::z3::cycle;
pickup pencircle scaled .4pt; draw star;
cullit;  pickup pencircle scaled 1.6pt;
for k=0 upto 4: undraw subpath(k+.55,k+.7) of star; endfor
cullit;  pickup pencircle scaled .4pt;
for k=0 upto 4: draw subpath(k+.47,k+.8) of star; endfor
labels(0,1,2,3,4); endchar;

beginchar(31,2/3*11pt#,.5*11pt#,0); % \oneu=31
pickup pencircle scaled 3/4pt yscaled 1/3 rotated 30;
save ww; ww=3/2w;
save t; transform t;
t=identity rotatedaround((.5ww,h),-90);
x2=.35ww; x3=good.x .6ww;
y2=good.y .2h; top y3=round .8h+eps;
save p; path p; p=z2{right}...{up}z3;
top z1=point .5 of p transformed t;
draw (z1...p);
labels(1,2,3); endchar;

beginchar(38,11pt#,11pt#,0); % \fouru=38
pickup pencircle scaled 3/4pt yscaled 1/3 rotated 30;
save t; transform t;
t=identity rotatedaround((.5w,.5h),-90);
x2=.35w; x3=good.x .6w;
y2=good.y .1h; top y3=round .4h+eps;
save p; path p; p=z2{right}...{up}z3;
top z1=point .5 of p transformed t;
draw (z1...p);
addto currentpicture also currentpicture transformed t;
addto currentpicture also currentpicture transformed(t transformed t);
labels.bot(1,3); labels.rt(2); endchar;

beginchar(39,11pt#,11pt#,0); % \fourc=39
pickup pencircle scaled 3/4pt yscaled 1/3 rotated 30;
save t; transform t;
t=identity rotatedaround((.5w,.5h),-90);
x2=.35w; x3=good.x .6w;
y2=good.y .1h; top y3=round .4h+eps;
save p; path p; p=z2{right}...{up}z3;
top z1=point .5 of p transformed t;
draw (z1...p) rotatedaround((.5w,.5h),-45)
 withpen pencircle scaled 3/4pt yscaled 1/3 rotated-15;
addto currentpicture also currentpicture transformed t;
addto currentpicture also currentpicture transformed(t transformed t);
labels.bot(1,3); labels.rt(2); endchar;

message "Circle variations";

beginchar(32,5pt#,5pt#,0); "Quarter circle";  % \circa
pickup pencircle scaled (.4pt+blacker);
draw quartercircle scaled 10pt; endchar;

beginchar(33,5pt#,5pt#,0); "Filled quarter circle";  % \circb
fill ((0,0)--quartercircle--cycle) scaled 10pt; endchar;

beginchar(34,5pt#,5pt#,0); "Rotated quarter circle";  % \circc
pickup pencircle scaled (.4pt+blacker);
draw quartercircle rotated 90 scaled 10pt shifted (5pt,0); endchar;

beginchar(35,5pt#*sqrt2,5pt#,0); "Cone";  % \circd
pickup pencircle scaled (.4pt+blacker);
draw ((0,0)--quartercircle--cycle)
 rotated 45 scaled 10pt shifted (.5w,0); endchar;

beginchar(36,10pt#,7.5pt#,2.5pt#); "Concentric circles";  % \circe
pickup pencircle scaled (.4pt+blacker);
for D=.2w,.6w,w:
 draw fullcircle scaled D shifted (.5w,.5[-d,h]);
 endfor endchar;

beginchar(37,10pt#,7.5pt#,2.5pt#); "Concentric diamonds";  % \circf
pickup pencircle scaled (.4pt+blacker);
for D=.2w,.6w,w:
 draw unitsquare shifted -(.5,.5) rotated 45
  scaled (D/sqrt2) shifted (.5w,.5[-d,h]);
 endfor endchar;

message "Miscellaneous symbols"; % mostly from the old manfnt

beginchar(oct"171",15pt#,7.5pt#,2.5pt#); % arrow for errata lists
curve#:=30/36pt#; dcurve#:=60/36pt#; bar#:=25/36pt#;
define_whole_blacker_pixels(curve,dcurve,bar);
penpos1(curve,90); penpos2(curve,90); penpos3(dcurve,90);
penpos4(dcurve,90); penpos5(curve,90); penpos6(curve,90);
y1r=vround(y1r-(y1-.5[-d,h])); y2=y5=y6=y1=y0; y4l=-d; y3r=h;
x1=0; x2=.1w; x3=.2w; x4=.55w; x5=.65w;
x2l:=x2l+.25curve; x5r:=x5r-.25curve;
penstroke z1e--z2e--z3e--z4e--z5e;    % crooked arrow
penpos13(bar,0); penpos14(bar,0); x0=w;
y13-y0=y0-y14=.24h+eps; x13=x14=7/8w-eps;
penpos15(.5bar,angle(z14-z0)); z15l=z0; penpos16(.5bar,angle(z13-z0)); z16l=z0;
z19=.381966[.5[z13,z14],z0];
numeric t; path p; p=z14l{z19-z14}..z16r;
t=xpart(p intersectiontimes((0,y6l)--(w,y6l))); x6=xpart point t of p;
filldraw z0..{z14-z19}z14r--subpath (0,t) of\\(z14l{z19-z14}..z16r)
 --z6l--z5l--z5r--z6r--subpath (t,0) of\\(z13l{z19-z13}..z15r)
 --z13r{z19-z13}..z0 & cycle;  % arrowhead and link
penlabels(range 1 thru 19); endchar;

beginchar(oct"170", 5pt#, 6.25pt#, 0); "Triangle for exercises";
x1=x2=w-x3=round .43pt; y3=.5+floor.5h;
z1-z2=(z3-z2) rotated 60;
y1:=.5sqrt3+round(y1-.5sqrt3); y2:=h-y1;
fill z1--z2--z3--cycle;
labels(1,2,3); endchar;

beginchar("6",256/36pt#,250/36pt#,0); % upper triangle for Addison-Wesley logo
x1=round 5/36pt; x2=round .5w; x2-x1=x3-x2=(y2-y1)/(sqrt 3);
y1=y3=0; fill z1--z2--z3--cycle; labels(1,2,3); endchar;

beginchar("7",256/36pt#,250/36pt#,0); % lower triangle for Addison-Wesley logo
x1=round 5/36pt; x2=round .5w; x2-x1=x3-x2=(y1-y2)/(sqrt 3);
y1=y3; y2=0; fill z1--z2--z3--cycle; labels(1,2,3); endchar;

def font_setup=
define_pixels(u,tiny,axis,hheight,border);
define_blacker_pixels(hair,thin,thick,rulethickness);
pickup if tiny<.5: nullpen else: pencircle scaled tiny fi;
tinypen:=savepen;
currenttransform:=identity yscaled aspect_ratio slanted slant;
enddef;

% typical cmr10 parameters
u#:=20/36pt#;
tiny#:=0;
axis#:=90/36pt#;
hheight#:=250/36pt#;
border#:=20/36pt#;
hair#:=8/36pt#;
thin#:=9/36pt#;
thick#:=25/36pt#;
fixwidth:=0;
slant:=0;
rulethickness#:=.4pt#;

baselinedistance#:=11pt#;
heavyline#:=50/36pt#;
font_setup;
define_whole_pixels(baselinedistance);
define_blacker_pixels(heavyline);

beginchar(127,25u#,hheight#+border#,0); "Dangerous bend sign";
pickup pencircle scaled rulethickness;
top y1=25/27h; lft x4=0;
x1+x1=x1a+x1b=x4b+x2a=x4+x2=x4a+x2b=x3b+x3a=x3+x3=w;
x4a=x4b=x4+u; x3b=x1a=x1-2u;
y4+y4=y4a+y4b=y3b+y1a=y3+y1=y3a+y1b=y2b+y2a=y2+y2=0;
y1a=y1b=y1-2/27h; y4b=y2a=y4+4/27h;
draw z1a..z1..z1b---z2a..z2..z2b---
  z3a..z3..z3b---z4a..z4..z4b---cycle;  % signboard
x10=x11=x12=x13=good.x(.5w-u); x14=x15=x16=x17=w-x10;
y10=y14=28/27h+epsilon; bot y13=-baselinedistance;
z11=(z10..z13) intersectionpoint (z1a{z1a-z4b}..z1{right});
y15=y11; y16=y12=-y11; y17=y20=y21=y13;
draw z11--z10--z14--z15; draw z12--z13; draw z16--z17;  % signpost
x20=w-x21; x21-x20=16u; draw z20--z21;  % ground level
x38=w-x31; x38-x31=8u; x32=x34=x38; x31=x35=x37;
y31=-y38=12/27h; y32=-y37=9/27h; y34=-y35=3/27h;
pickup pencircle scaled heavyline;
draw z32{z32-z31}..z34---z35..z37{z38-z37};  % the dangerous bend
pickup penrazor xscaled heavyline rotated (angle(z32-z31)+90);
draw z31--z32; draw z37--z38;    % upper and lower bars
labels(1,1a,1b,2,2a,2b,3,3a,3b,4,4a,4b,10,11,12,13,14,15,16,17,20,21,
  31,32,33,34,35,36,37,38);
picture dbend; dbend=currentpicture;
endchar;
beginchar(126,25u#,hheight#+border#,0); "Lefthanded ditto";
currentpicture:=dbend reflectedabout((.5w,0),(.5w,h));
endchar;
beginchar(0,25u#,hheight#+border#,0); "Reverse video ditto";
fill (0,-11pt)--(w,-11pt)--(w,h)--(0,h)--cycle;
addto currentpicture also -dbend;
endchar;

beginchar(oct"140",3.75pt#,7pt#,4/3pt#); "special 1/7 for a quotation";
currenttransform:=currenttransform slanted(2/7/aspect_ratio);
y3=y4=.5[h,-d]=.5[y2,y5]; y5=y6;
x1=x2=x7=.5w; x5+x6=x3+x4=w; x5=x3+1/6pt;
pickup pencircle xscaled .5pt yscaled .35pt;
bot y2=top y3+pt; top y1=h; bot y7=-d; lft x3=0; % y2 moved up 1/3pt (Feb 5)
draw z1..z2; draw z3..z4;
draw z5--z6..{down}z7;
labels(1,2,3,4,5,6,7);
endchar;
currenttransform:=currenttransform slanted(-2/7/aspect_ratio);

% Circumscribed circles
pickup pencircle scaled(.4pt+blacker); rpen:=savepen;
def begincircle(expr code,units,depth,asp,superness)=
beginchar(code,units*20/36pt#,0,0); pickup rpen;
aa:=.5(w++depth*pt/asp);
x2=x4=.5[x1,x3]=.5w; y1=y3=.5[y2,y4]=-.5round(depth*pt);
x1=good.x(x2+aa); y2=good.y(y1+asp*aa);
draw superellipse(z1,z2,z3,z4,superness); labels(1,2,3,4) enddef;

"Ellipse for floating-point mod operator"; % also for pseudo coin top
begincircle(oct"130",29,5,.5,.75786); endchar;

"Edge and bottom of pseudo coin";
begincircle(oct"133",29,5,.5,.75786); charht:=2pt#;
erase fill rt z1--(rt x1,top y2)--(lft x3,top y2)--lft z3--cycle;
x0=x1; x5=x3; y0=y5=y1+2pt; draw z0--z1; draw z3--z5; labels(0,5); endchar;

"Circle to enclose two digits";
begincircle(oct"131",19,7.5,1,.75786); endchar;

"Circle to enclose an exponent of 2";
begincircle(oct"132",9,6,1,1/sqrt2); endchar;

% Now we do the \qc font from TeXbook Appendix D
pickup pencircle scaled ceiling pt; ptpen:=savepen;

beginchar("a",10pt#,5.5pt#,4.5pt#); pickup ptpen; % W to S
bot y1=lft x2=0; x2=.5[x1,x1+w]; y1=.5[y2,y2+h+d];
draw z1{right}..{down}z2; labels(1,2); endchar;

beginchar("b",10pt#,5.5pt#,4.5pt#); pickup ptpen; % W to N
bot y1=lft x2=0; x2=.5[x1,x1+w]; y1=.5[y2,y2-h-d];
draw z1{right}..{up}z2; labels(1,2); endchar;

beginchar("c",10pt#,5.5pt#,4.5pt#); pickup ptpen; % E to N
bot y1=lft x2=0; x2=.5[x1,x1-w]; y1=.5[y2,y2-h-d];
draw z1{left}..{up}z2; labels(1,2); endchar;

beginchar("d",10pt#,5.5pt#,4.5pt#); pickup ptpen; % E to S
bot y1=lft x2=0; x2=.5[x1,x1-w]; y1=.5[y2,y2+h+d];
draw z1{left}..{down}z2; labels(1,2); endchar;

fontdimen 8: pt#; % rule thickness in \qc

message "METAFONT logo";

def arc(suffix i,j) =
       (z.i{0,y.j-y.i}..
  (beta[x.i,x.j],beta[y.j,y.i]){z.j-z.i}..
  z.j{x.j-x.i,0}) enddef;

def double_arc(suffix i,j,k) =
  arc(i,j) & reverse arc(k,j) enddef;

alpha:=.45;  % controls bar location and similar things
beta:=.2;  % controls squareness of bowls

def setparameters(text parameter_equations) =
  string code.M,code.E,code.T,code.A,code.F,code.O,code.N;
  numeric h#, xx#, yy#, o#, s#, u#, px#, py#;
  numeric leftstemloc, barheight;
  parameter_equations;
  yy#=(h#/13.5u#)*xx#; define_whole_pixels(xx,yy);
  define_pixels(s,u);
  define_corrected_pixels(o);
  py#=.9px#; define_blacker_pixels(px,py);
  pickup pencircle xscaled px yscaled py;
  logo_pen:=savepen;
  leftstemloc:=good.x((2.5u#+s#)*pt);
  barheight:=good.y(alpha*h#*pt);
  ligtable code.T: code.A kern -.5u#;
  ligtable code.F: code.O kern -u#;
enddef;

def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
  beginchar(code.c,n*u#+2s#,h#,0); pickup logo_pen enddef;

def do_it =
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+yy;
draw z1--z2--z3--z4--z5;
labels(1,2,3,4,5);
endchar;

beginlogochar(E,14);
x1=x2=x3=leftstemloc; x4=x6=w-x1+o; x5=x4-xx;
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 h#*slant+.5u#;
if odd(w-px): w:=w+1; fi  % allows a symmetric stem
lft x1=-epsilon; x2=w-x1; x3=x4=.5w; % I tried lft x1=s-o; not as good
y1=y2=y3; top.y1=h; bot.y4=-o;
draw z1..z2; draw z3..z4;
labels(1,2,3,4);
endchar;

beginlogochar(A,15);  % changed from 16 on Oct 16!
x1+x4=x2+x3=2x5=w; x1=x2=leftstemloc;
y1=y4; y2=y3; bot.y1=-o; top.y5=h+o; y2=barheight;
draw double_arc(2,5,3); draw z1--z2--z3--z4;
labels(1,2,3,4,5);
endchar;

beginlogochar(F,14);
x1=x2=x3=leftstemloc; x4=w-x1+o; x5=x4-xx;
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(O,15);
x1+x2=x3+x4=w; x1=good.x(1.5u+s); x3=x4;
bot.y3=-o; top.y4=h+o; y1=y2=barheight;
draw double_arc(1,4,2); draw double_arc(2,3,1);
labels(1,2,3,4);
endchar;

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

% ten-point size
message "  ten point";
setparameters(h#=6;  % height of characters, in pt
slant:=0;
  xx#=0.6;  % extra length of certain features, in pt
  u#=4/9;  % unit width, in pt
  s#=0;  % extra sidebar, in pt
  o#=1/9;  % overshoot of curves, in pt
  px#=2/3;  % horizontal thickness of pen, in pt
  code.M="M"; code.E="E"; code.T="T"; code.A="A";
  code.F="F"; code.O="O"; code.N="N")
do_it;

currenttransform:=currenttransform slanted(.25/aspect_ratio);
% ten-point size, slanted: 89:;<=>: = METAFONT!
message "  slanted ten point";
setparameters(h#=6;  % height of characters, in pt
slant:=.25;
  xx#=0.6;  % extra length of certain features, in pt
  u#=4/9;  % unit width, in pt
  s#=0;  % extra sidebar, in pt
  o#=1/9;  % overshoot of curves, in pt
  px#=2/3;  % horizontal thickness of pen, in pt
  code.M="8"; code.E="9"; code.T=":"; code.A=";";
  code.F="<"; code.O="="; code.N=">")
do_it;
currenttransform:=currenttransform slanted(-.25/aspect_ratio);

% nine-point size: hijklmnj = METAFONT!
message "  nine point";
setparameters(h#=.9*6;  % height of characters, in pt
slant:=0;
  xx#=.9*0.6;  % extra length of certain features, in pt
  u#=.91*4/9;  % unit width, in pt
  s#=.08;  % extra sidebar, in pt
  o#=1/10;  % overshoot of curves, in pt
  px#=.9*2/3;  % horizontal thickness of pen, in pt
  code.M="h"; code.E="i"; code.T="j"; code.A="k";
  code.F="l"; code.O="m"; code.N="n")
do_it;
font_quad  18u#+2s#;  % we take spacing from the 9-point logo font
font_normal_space  6u#+2s#;
font_normal_stretch  3u#;
font_normal_shrink  2u#;

% eight-point size: opqrstuq = METAFONT!
message "  eight point";
setparameters(h#=.8*6;  % height of characters, in pt
slant:=0;
  xx#=.8*0.6;  % extra length of certain features, in pt
  u#=.82*4/9;  % unit width, in pt
  s#=.2;  % extra sidebar, in pt
  o#=1/12;  % overshoot of curves, in pt
  px#=.8*2/3;  % horizontal thickness of pen, in pt
  code.M="o"; code.E="p"; code.T="q"; code.A="r";
  code.F="s"; code.O="t"; code.N="u")
do_it;

% eight-point size, magnified 10/8: /0123451 = METAFONT!
message "  magnified eight point";
setparameters(h#=.8*6*10/8;  % height of characters, in pt
slant:=0;
  xx#=.8*0.6*10/8;  % extra length of certain features, in pt
  u#=.82*4/9*10/8;  % unit width, in pt
  s#=.2*10/8;  % extra sidebar, in pt
  o#=1/12*10/8;  % overshoot of curves, in pt
  px#=.8*2/3*10/8;  % horizontal thickness of pen, in pt
  code.M="/"; code.E="0"; code.T="1"; code.A="2";
  code.F="3"; code.O="4"; code.N="5")
do_it;

currenttransform:=currenttransform slanted(2/7/aspect_ratio);
% eight-point size, slanted: \]^_efg^ = METAFONT!
message "  slanted eight point";
slant:=2/7;
setparameters(h#=.8*6;  % height of characters, in pt
  xx#=.8*0.6;  % extra length of certain features, in pt
  u#=.82*4/9;  % unit width, in pt
  s#=.2;  % extra sidebar, in pt
  o#=1/12;  % overshoot of curves, in pt
  px#=.8*2/3;  % horizontal thickness of pen, in pt
  code.M="\"; code.E="]"; code.T="^"; code.A="_";
  code.F="e"; code.O="f"; code.N="g")
do_it;
currenttransform:=currenttransform slanted(-2/7/aspect_ratio);

% special size for the title page: ()*+,-.* = METAFONT!
message "  title page size";
setparameters(h#=250/9;  % height of characters, in pt (same as cmssc40)
slant:=0;
  xx#=2.9;  % extra length of certain features, in pt
  u#=(1+sqrt5)/2;  % unit width, in pt
  s#=.2;  % extra sidebar, in pt
  o#=4/9;  % overshoot of curves, in pt
  px#=4;  % horizontal thickness of pen, in pt
  code.M="("; code.E=")"; code.T="*"; code.A="+";
  code.F=","; code.O="-"; code.N=".")
do_it;

currenttransform:=currenttransform slanted(-1/9/aspect_ratio);
% backslanted skinny bold: BCDGHIJD = METAFONT!
message "  weird skinny bold condensed";
setparameters(h#=25;  % height of characters, in pt
slant:=-1/9;  % leftward bias
  xx#=1.5;  % extra length of certain features, in pt
  u#=3/9;  % unit width, in pt
  s#=1/3;  % extra sidebar, in pt
  o#=2/9;  % overshoot of curves, in pt
  px#=1;  % horizontal thickness of pen, in pt
  code.M="B"; code.E="C"; code.T="D"; code.A="G";
  code.F="H"; code.O="I"; code.N="J")
do_it;
currenttransform:=currenttransform slanted(+1/9/aspect_ratio);

% ultrawide light: KLUVWvwU = METAFONT!
message "  weird light extended";
setparameters(h#=6;  % height of characters, in pt
slant:=0;
  xx#=2;  % extra length of certain features, in pt
  u#=4/3;  % unit width, in pt
  s#=-2/3;  % extra sidebar, in pt
  o#=1/9;  % overshoot of curves, in pt
  px#=1/3;  % horizontal thickness of pen, in pt
  code.M="K"; code.E="L"; code.T="U"; code.A="V";
  code.F="W"; code.O="v"; code.N="w")
do_it;

message "Pixel symbols";

beginchar("P",722.7/722.909pt#,722.7/722.909pt#,0); % 1pt pixel
pickup pencircle scaled .2pt;
top lft z1=(0,.8h); top rt z2=(.8w,.8h);
bot lft z3=(0,0); bot rt z4=(.8w,0);
draw z1--z4; draw z2--z3; endchar;

beginchar("Q",722.7/722.909pt#,722.7/722.909pt#,0); % 1pt nonpixel
pickup pencircle scaled .2pt;
drawdot(.4w,.4h); endchar;

beginchar("R",3*722.7/722.909pt#,3*722.7/722.909pt#,0); % 3pt pixel
pickup pencircle scaled .3pt;
interim autorounding:=0;
top lft z1=(0,.9h); top z2=(.45w,.9h); top rt z3=(.9w,.9h);
lft z4=(0,.45h); rt z5=(.9w,.45h);
bot lft z6=(0,0); bot z7=(.45w,0); bot rt z8=(.9w,0);
draw z1+(-50epsilon,50epsilon)--z8+(50epsilon,-50epsilon);
draw z2+(0,50epsilon)--z7-(0,50epsilon);
draw z3+(50epsilon,50epsilon)--z6-(50epsilon,50epsilon);
draw z4-(50epsilon,0)--z5+(50epsilon,0); endchar;

beginchar("S",3*722.7/722.909pt#,3*722.7/722.909pt#,0); % 3pt nonpixel
pickup pencircle scaled .3pt;
drawdot(.45w,.45h); endchar;

message "Gothic d";

beginchar("?",4pt#,8pt#,0);
 % taken from NB, but my changes may have spoiled it
stem_length#:=10/6.7pt#; define_blacker_pixels(stem_length);
xheight:=6pt;
penpos1  (2*stem_length,30);     % normal points
penpos2  (2*stem_length,30);   % normal points
penpos3  (2*stem_length,30);  % normal points
penpos4  (2*stem_length,30);  % normal points

x1l=x2=0;  y1r=xheight; y2l=0;
  penpos40(stem_length,30); z40r=round z1;
  penpos41(stem_length,40); x40r=x41r=x42r; y41=.5[y40,y42];
  penpos42(stem_length,30); y42l=y2;
fill z40r--(x40r,y42l)--z42l...z41l{up}...z40l--cycle; % left stem

x3=x4r=w; y3=y1; y4=y2;
  penpos50(stem_length,30); z50l=round z3l;
  penpos51(stem_length,40); x50l=x51l=x52l; y51=.5[y50,y52];
  penpos52(stem_length,30); y52l=y4;
fill z52l--(x52l,y50r)--z50r...z51r{down}...z52r--cycle; % right stem

  penpos10(stem_length,30); z10=z42;
  penpos11(stem_length,25); x11=.5[x10,x12]; y10l=y11=y12r;
  penpos12(stem_length,30); x12r=x4; % redundant: y12l=0;
  penpos14(stem_length*(1+cosd30),30); z14l=z12l;
  penpos15(.07stem_length,120); z15l=z14r;
fill z10l...z11l{z12-z10}...z12l--z14r
 --z15r{z14l-z14r}...z11r{z10-z12}...z10r--cycle;  % lower join

numeric ch; ch=10; % Neenie's version was more like ch=7.5 (steeper)
numeric s_length[];
 s_length0*cosd(30-ch)=stem_length*cosd 30;
 s_length1*cosd(40-ch)=stem_length*cosd 40;
pair corner; corner=z50r;
vardef f(expr theta)=
 save x,y; penpos60(s_length0,theta); y60r=h; x60l=0;
 angle(z60r-corner)<theta+60+ch enddef;
numeric theta; theta=solve f(90,0);
  penpos60(s_length0,theta); y60r=h; x60l=0;
  penpos61(s_length1,theta+10); z61l=.5[z60l,z62l];
  penpos62(s_length0,theta); z62r=corner;
fill z60l--((z60l--z62l)intersectionpoint((x4,0)--(x4,h)))
 --z62r...z61r{z60-z62}...z60r--cycle;      % diagonal

charwd:=charwd+1.03277pt#; w:= w + round(1.03277pt);
penlabels(1,2,3,4,10,11,12,13,14,15,40,41,42,50,51,52,60,61,62);
interim xoffset:=.46687pt; interim yoffset:=-.3pt;
endchar;

bye

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.