summaryrefslogtreecommitdiff
path: root/fonts/cm/mf/romanp.mf
blob: ce20bef287bb3b4c0685858f403200caa638f318 (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
% THIS IS THE OFFICIAL COMPUTER MODERN SOURCE FILE romanp.mf BY D E KNUTH.
% IT MUST NOT BE MODIFIED IN ANY WAY UNLESS THE FILE NAME IS CHANGED!

% This file contains `\$' and `\&' and `?' in the so-called roman style.

% Codes \0044, \0046, and \0077 are generated, as well as code |spanish_query|
% (for a Spanish question mark) if that code value is known.

cmchar "Dollar sign";
beginchar("$",9u#,body_height#,body_height#-asc_height#);
italcorr fig_height#*slant-.5u#; % same as for digits
adjust_fit(0,0);
numeric theta; theta=90-angle(50u,asc_height); slope:=-asc_height/50u;
pickup fine.nib; pos2(slab,-90);
pos0(cap_stem,theta); pos7(slab,-90);
x2=x0=x7=.5w; top y2l=asc_height+oo; bot y7r=-oo;
y0=.52asc_height; lft x3l=hround u; rt x6r=hround(w-u);
x3r-x3l=x6r-x6l=hround .35[slab,cap_stem]-fine;
ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
filldraw stroke super_arc.e(2,3) & z3e{down}
 ..z4e---z5e..z6e{down} & super_arc.e(6,7);  % main stroke
if serifs: pos1(hair,0); pos8(hair,180);
 pos10(flare,0); pos9(flare,180);
 rt x1r=hround(w-u); lft x8r=hround u; y1=.5[y0,y2]; y8=.5[y0,y7];
 {{less_tense; pos2'(slab,90); z2'=z2; bulb(2',1,10);  % upper arc and bulb
 bulb(7,8,9)}};  % lower arc and bulb
else: pos1(.6[slab,flare],-100); pos8(flare,-100);
 rt x1l=hround(w-1.3u); lft x8r=hround .8u;
 top y1l=vround .92asc_height+oo; bot y8r=vround .1asc_height-oo;
 filldraw stroke term.e(2,1,right,.9,4);  % upper arc and terminal
 filldraw stroke term.e(7,8,left,1,4); fi  % lower arc and terminal
pickup crisp.nib; pos12(bar,0); pos11(bar,0);
lft x12l=lft x11l=hround(.5w-.5bar); top y12=h; bot y11=-d;
filldraw stroke z12e--z11e;  % vertical crossbar
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12); endchar;

cmchar "Ampersand";
beginchar("&",14u#,asc_height#,0);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
pickup tiny.nib; pos2(slab,-90); x2=4u; bot y2r=-o;
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(fudged.hair,0);
 rt x0r+jut=hround(w-.9u); top y0=x_height;
 pos1(fudged.hair,0); z1=whatever[z0,(.6[x0,x2],0)];
 y1=max(y0-1.5bracket-.2x_height,2/3x_height);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .75[bar_height,x_height]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(h-2vair-slab)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
lft x3r=hround .75u; x5=.5[x3r,x6l]; lft x6r=hround .5(w-u);
x3l-x3r=curve-tiny; pos6(reduced_hair,180);
pos5(vair,theta); y5=.5h;
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(vair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(fudged.stem,30); x8l=good.x(x8l+3.5u-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(slab,90); x10=w-3.5u; bot y10l=-o;
pos9(fudged.stem,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(slab,90); z10'=z10;
 pos11(fudged.hair,180); rt x11l=hround(w-u); y11=.5bar_height;
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(slab,90); z10'=z10;
 pos11(Vround .5[slab,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .07bar_height-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

cmchar "Question mark";
beginchar("?",8.5u#,asc_height#,0);
italcorr .8asc_height#*slant;
adjust_fit(0,0);
pickup tiny.nib; pos7(dot_size,0); pos8(dot_size,90);
lft x7l=hround(.5w-.25u-.5dot_size); bot y8l=0; z7=z8; dot(7,8);  % dot
numeric bot_width;
bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
pickup fine.nib; pos2(vair,90); pos3(curve,0);
pos4(vair,-90); pos5(bot_width,0); pos6(bot_width,0);
x2=x4=x5=x6=x7; rt x3r=hround(w-u); bot y6=1+.25[top y8r,x_height];
top y2r=h+oo; y3=.75[y6,y2]; y4=.5[y6,y2]; y5=.1[y6,y2];
{{interim superness:=more_super;
filldraw stroke pulled_super_arc.e(2,3)(superpull)
 & subpath (0,1) of super_arc.e(3,4) .. z5e---z6e\\}};  % arc and stem
if serifs: pos1(hair,180); pos0(flare,180);
 lft x1r=hround u; y1=y3; bulb(2,1,0);  % bulb
else: pos1(Vround 5/7[vair,flare],110);
 lft x1r=hround u; top y1r=vround .9[y6,top y2r];
 filldraw stroke term.e(2,1,left,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8); endchar;

iff known spanish_query: cmchar "Spanish open question mark";
beginchar(spanish_query,8.5u#,asc_height#-desc_depth#,desc_depth#);
adjust_fit(0,0);
pickup tiny.nib; pos7(dot_size,0); pos8(dot_size,90);
lft x7l=hround(.5w-.25u-.5dot_size); top y8r=h; z7=z8; dot(7,8);  % dot
numeric top_width;
top_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
pickup fine.nib; pos2(vair,270); pos3(curve,180);
pos4(vair,90); pos5(top_width,180); pos6(top_width,180);
x2=x4=x5=x6=x7; lft x3r=hround u; top y6=.25[bot y8l,h-x_height]-1;
bot y2r=-d-oo; y3=.75[y6,y2]; y4=.5[y6,y2]; y5=.1[y6,y2];
{{interim superness:=more_super;
filldraw stroke pulled_super_arc.e(2,3)(superpull)
 & subpath (0,1) of super_arc.e(3,4) .. z5e---z6e\\}};  % arc and stem
if serifs: pos1(hair,0); pos0(flare,0);
 rt x1r=hround(w-u); y1=y3; bulb(2,1,0);  % bulb
else: pos1(Vround 5/7[vair,flare],-70);
 rt x1r=hround(w-u); bot y1r=vround .9[y6,bot y2r];
 filldraw stroke term.e(2,1,right,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8); endchar;