| 1 |
% Based on the Computer Modern source file romms.mf by D E Knuth. |
| 2 |
|
| 3 |
% Edited by Ariel Barton to produce better sans serif symbols |
| 4 |
|
| 5 |
% Date: 2013/03/22 |
| 6 |
|
| 7 |
% This file contains special characters of ``math italic'' fonts |
| 8 |
% that actually are not supposed to be slanted. |
| 9 |
% Codes \0050--\0057, \0072--\0077, and \0133--\0137 are generated. |
| 10 |
|
| 11 |
% The italic corrections are zero in all of these characters. |
| 12 |
|
| 13 |
cmchar "Leftward top half arrow"; |
| 14 |
compute_spread(.45x_height#,.55x_height#); |
| 15 |
beginchar(oct"050",18u#,v_center(spread#+rule_thickness#)); |
| 16 |
adjust_fit(0,0); pickup crisp.nib; |
| 17 |
pos1(rule_thickness,90); pos2(rule_thickness,90); |
| 18 |
pos3(rule_thickness,0); pos4(rule_thickness,0); |
| 19 |
y0=y1=y2=math_axis; x1+.5rule_thickness=hround(w-u); lft x0=hround u; |
| 20 |
y3-y0=y0-y4=.36asc_height+eps; x3=x4=x0+4u+eps; |
| 21 |
pos5(rule_thickness,angle(z4-z0)); z5l=z0; |
| 22 |
pos6(rule_thickness,angle(z3-z0)); z6l=z0; |
| 23 |
numeric t; path p; p=z4r..{2(x0-x4),y0-y4}z6r; |
| 24 |
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p; |
| 25 |
filldraw z0--(x0,y2l)--z1l{right}..{left}z1r |
| 26 |
--subpath (t,0) of\\(z3r..{2(x0-x3),y0-y3}z5r) |
| 27 |
--z3l..{2(x0-x3),y0-y3}cycle; % arrowhead and stem |
| 28 |
penlabels(0,1,2,3,4,5,6); endchar; |
| 29 |
|
| 30 |
cmchar "Leftward bottom half arrow"; |
| 31 |
compute_spread(.45x_height#,.55x_height#); |
| 32 |
beginchar(oct"051",18u#,v_center(spread#+rule_thickness#)); |
| 33 |
adjust_fit(0,0); pickup crisp.nib; |
| 34 |
pos1(rule_thickness,90); pos2(rule_thickness,90); |
| 35 |
pos3(rule_thickness,0); pos4(rule_thickness,0); |
| 36 |
y0=y1=y2=math_axis; x1+.5rule_thickness=hround(w-u); lft x0=hround u; |
| 37 |
y3-y0=y0-y4=.36asc_height+eps; x3=x4=x0+4u+eps; |
| 38 |
pos5(rule_thickness,angle(z4-z0)); z5l=z0; |
| 39 |
pos6(rule_thickness,angle(z3-z0)); z6l=z0; |
| 40 |
numeric t; path p; p=z4r..{2(x0-x4),y0-y4}z6r; |
| 41 |
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p; |
| 42 |
filldraw z0{2(x4-x0),y4-y0}..z4l |
| 43 |
--subpath (0,t) of\\(z4r..{2(x0-x4),y0-y4}z6r) |
| 44 |
--z1l{right}..{left}z1r--(x0,y2r)--cycle; % arrowhead and stem |
| 45 |
penlabels(0,1,2,3,4,5,6); endchar; |
| 46 |
|
| 47 |
cmchar "Rightward top half arrow"; |
| 48 |
compute_spread(.45x_height#,.55x_height#); |
| 49 |
beginchar(oct"052",18u#,v_center(spread#+rule_thickness#)); |
| 50 |
adjust_fit(0,0); pickup crisp.nib; |
| 51 |
pos1(rule_thickness,90); pos2(rule_thickness,90); |
| 52 |
pos3(rule_thickness,0); pos4(rule_thickness,0); |
| 53 |
y0=y1=y2=math_axis; x1-.5rule_thickness=hround u; rt x0=hround(w-u); |
| 54 |
y3-y0=y0-y4=.36asc_height+eps; x3=x4=x0-4u-eps; |
| 55 |
pos5(rule_thickness,angle(z4-z0)); z5l=z0; |
| 56 |
pos6(rule_thickness,angle(z3-z0)); z6l=z0; |
| 57 |
numeric t; path p; p=z4l..{2(x0-x4),y0-y4}z6r; |
| 58 |
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p; |
| 59 |
filldraw z0--(x0,y2l)--z1l{left}..{right}z1r |
| 60 |
--subpath (t,0) of\\(z3l..{2(x0-x3),y0-y3}z5r) |
| 61 |
--z3r..{2(x0-x3),y0-y3}cycle; % arrowhead and stem |
| 62 |
penlabels(0,1,2,3,4,5,6); endchar; |
| 63 |
|
| 64 |
cmchar "Rightward bottom half arrow"; |
| 65 |
compute_spread(.45x_height#,.55x_height#); |
| 66 |
beginchar(oct"053",18u#,v_center(spread#+rule_thickness#)); |
| 67 |
adjust_fit(0,0); pickup crisp.nib; |
| 68 |
pos1(rule_thickness,90); pos2(rule_thickness,90); |
| 69 |
pos3(rule_thickness,0); pos4(rule_thickness,0); |
| 70 |
y0=y1=y2=math_axis; x1-.5rule_thickness=hround u; rt x0=hround(w-u); |
| 71 |
y3-y0=y0-y4=.36asc_height+eps; x3=x4=x0-4u-eps; |
| 72 |
pos5(rule_thickness,angle(z4-z0)); z5l=z0; |
| 73 |
pos6(rule_thickness,angle(z3-z0)); z6l=z0; |
| 74 |
numeric t; path p; p=z4l..{2(x0-x4),y0-y4}z6r; |
| 75 |
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p; |
| 76 |
filldraw z0{2(x4-x0),y4-y0}..z4r |
| 77 |
--subpath (0,t) of\\(z4l..{2(x0-x4),y0-y4}z6r) |
| 78 |
--z1l{left}..{right}z1r--(x0,y2r)--cycle; % arrowhead and stem |
| 79 |
penlabels(0,1,2,3,4,5,6); endchar; |
| 80 |
|
| 81 |
cmchar "Left hook"; |
| 82 |
compute_spread(.45x_height#,.55x_height#); |
| 83 |
beginchar(oct"054",5u#,v_center(2spread#+rule_thickness#)); |
| 84 |
adjust_fit(0,0); pickup rule.nib; autorounded; |
| 85 |
lft x2=hround u-eps; x1=x3=w-x2; |
| 86 |
y1-y3=spread; y2=.5[y1,y3]; y3=math_axis; |
| 87 |
draw z1{left}...z2{down}...z3{right}; % hook |
| 88 |
labels(1,2,3); endchar; |
| 89 |
|
| 90 |
cmchar "Right hook"; |
| 91 |
compute_spread(.45x_height#,.55x_height#); |
| 92 |
beginchar(oct"055",5u#,v_center(2spread#+rule_thickness#)); |
| 93 |
adjust_fit(0,0); pickup rule.nib; autorounded; |
| 94 |
rt x2=hround(w-u)+eps; x1=x3=w-x2; |
| 95 |
y1-y3=spread; y2=.5[y1,y3]; y3=math_axis; |
| 96 |
draw z1{right}...z2{down}...z3{left}; % hook |
| 97 |
labels(1,2,3); endchar; |
| 98 |
|
| 99 |
cmchar "Triangle pointing right"; |
| 100 |
beginchar(oct"056",9u#,v_center(x_height#)); |
| 101 |
adjust_fit(0,0); pickup rule.nib; |
| 102 |
numeric a,b; a=sqrt(3.14159\\ /sqrt3); % triangle area $=$ circle area |
| 103 |
b=.5w-(rt hround u); .5[x1',x2']=.5w; x2'-x1'=a*b*sqrt3; |
| 104 |
x1=x3=good.x x1'; x2=good.x x2'; |
| 105 |
y2=.5[y1,y3]=math_axis; y1=good.y(y2+a*b); |
| 106 |
draw z1--z2--z3--cycle; % triangle |
| 107 |
labels(1,2,3); endchar; |
| 108 |
|
| 109 |
cmchar "Triangle pointing left"; |
| 110 |
beginchar(oct"057",9u#,v_center(x_height#)); |
| 111 |
adjust_fit(0,0); pickup rule.nib; |
| 112 |
numeric a,b; a=sqrt(3.14159\\ /sqrt3); % triangle area $=$ circle area |
| 113 |
b=.5w-(rt hround u); .5[x1',x2']=.5w; x1'-x2'=a*b*sqrt3; |
| 114 |
x1=x3=good.x x1'; x2=good.x x2'; |
| 115 |
y2=.5[y1,y3]=math_axis; y1=good.y(y2+a*b); |
| 116 |
draw z1--z2--z3--cycle; % triangle |
| 117 |
labels(1,2,3); endchar; |
| 118 |
|
| 119 |
cmchar "Period"; |
| 120 |
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#; |
| 121 |
define_whole_blacker_pixels(dot_diam); |
| 122 |
beginchar(oct"072",5u#,dot_diam#,0); % non-ASCII position |
| 123 |
adjust_fit(0,0); pickup fine.nib; |
| 124 |
pos1(dot_diam,0); pos2(dot_diam,90); |
| 125 |
lft x1l=hround(.5w-.5dot_diam); bot y2l=0; z1=z2; dot(1,2); % dot |
| 126 |
penlabels(1,2); endchar; |
| 127 |
|
| 128 |
cmchar "Comma"; |
| 129 |
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#; |
| 130 |
define_whole_blacker_pixels(dot_diam); |
| 131 |
beginchar(oct"073",5u#,dot_diam#,comma_depth#); % non-ASCII position |
| 132 |
adjust_fit(0,0); |
| 133 |
x1-.5dot_diam=hround(.5w-.5dot_diam); y1-.5dot_diam=0; |
| 134 |
comma(1,a,dot_diam,.2u,comma_depth); % dot and tail |
| 135 |
penlabels(1); endchar; |
| 136 |
|
| 137 |
cmchar "Less than sign"; |
| 138 |
compute_spread(5/4x_height#,3/2x_height#); |
| 139 |
beginchar("<",14u#,v_center(spread#+rule_thickness#)); |
| 140 |
italcorr h#*slant-u#; |
| 141 |
adjust_fit(0,0); pickup rule.nib; |
| 142 |
lft x2=hround 1.5u-eps; x1=x3=w-x2; |
| 143 |
y1-y3=spread; y2=.5[y1,y3]=math_axis; |
| 144 |
draw z1--z2--z3; % diagonals |
| 145 |
labels(1,2,3); endchar; |
| 146 |
|
| 147 |
cmchar "Virgule (slash)"; |
| 148 |
beginchar(oct"075",9u#,body_height#,paren_depth#); % non-ASCII position |
| 149 |
italcorr body_height#*slant-.5u#; |
| 150 |
adjust_fit(0,0); pickup rule.nib; |
| 151 |
rt x1=hround(w-u)+eps; top y1=h+eps; |
| 152 |
lft x2=hround u-eps; bot y2=-d-eps; |
| 153 |
draw z1--z2; % diagonal |
| 154 |
penlabels(1,2); endchar; |
| 155 |
|
| 156 |
cmchar "Greater than sign"; |
| 157 |
compute_spread(5/4x_height#,3/2x_height#); |
| 158 |
beginchar(">",14u#,v_center(spread#+rule_thickness#)); |
| 159 |
italcorr math_axis#*slant-u#; |
| 160 |
adjust_fit(0,0); pickup rule.nib; |
| 161 |
rt x2=hround(w-1.5u)+eps; x1=x3=w-x2; |
| 162 |
y1-y3=spread; y2=.5[y1,y3]=math_axis; |
| 163 |
draw z1--z2--z3; % diagonals |
| 164 |
labels(1,2,3); endchar; |
| 165 |
|
| 166 |
% We adjust this to have flattened points |
| 167 |
cmchar "Five-pointed star"; |
| 168 |
beginchar(oct"077",9u#,v_center(x_height#)); |
| 169 |
adjust_fit(0,0); pickup tiny.nib; |
| 170 |
numeric theta; theta=360/5; % degrees between points |
| 171 |
if not hefty: % Knuth's version comes first |
| 172 |
pos0(curve,0); pos1(rule_thickness,90); x0=x1=good.x .5w; |
| 173 |
top y1r=vround(math_axis+.5x_height+.5rule_thickness); |
| 174 |
ypart(.5[z1,z0+(z1-z2) rotated 2theta])=math_axis; |
| 175 |
pos2(curve,theta); pos3(rule_thickness,90+theta); |
| 176 |
z2=z0; z3-z0=(z1-z0) rotated theta; |
| 177 |
z4=whatever[z0l,z1r]=whatever[z2r,z3r]; |
| 178 |
filldraw for n=0 upto 4: |
| 179 |
z0+(z1r-z0)rotated(n*theta)--z0+(z4-z0)rotated(n*theta)--endfor |
| 180 |
cycle; % star |
| 181 |
penlabels(0,1,2,3,4); |
| 182 |
else: |
| 183 |
% Sans serif (hefty) version |
| 184 |
numeric star_tip; star_tip = rule_thickness/3; |
| 185 |
% Points and center of the star |
| 186 |
x0 = 0.5w; |
| 187 |
z1 = z0 + whatever*dir (90+theta); |
| 188 |
for k=2,3,4,5: z[k] = z0 + (z1-z0) rotated ((k-1)*theta); endfor |
| 189 |
for k=1 upto 5: |
| 190 |
if star_tip > tiny: pos[k](star_tip, k*theta); |
| 191 |
else: z[k]l=z[k]r=z[k]; |
| 192 |
fi |
| 193 |
endfor |
| 194 |
% Width and vertical position |
| 195 |
lft x1l = 0; 0.5[bot y2l, top y5] = math_axis; |
| 196 |
% Base of the points |
| 197 |
z6 = z0 + whatever * dir (90-theta/2); |
| 198 |
x6 = x0 + w/12; |
| 199 |
z7 = z6 + (tiny/3)*dir angle(z0-z6); |
| 200 |
% Draw the star |
| 201 |
if z4l = z4: |
| 202 |
filldraw for n=0 upto 4: |
| 203 |
(z4--z7) rotatedaround(z0,n*theta)--endfor cycle; |
| 204 |
else: |
| 205 |
filldraw for n=0 upto 4: |
| 206 |
(z4l--z6--z5r) rotatedaround(z0,n*theta)--endfor cycle; |
| 207 |
fi |
| 208 |
penlabels(0,1,2,3,4,5,6,7); |
| 209 |
fi |
| 210 |
endchar; |
| 211 |
|
| 212 |
cmchar "Musical flat sign"; |
| 213 |
beginchar(oct"133",7u#,body_height#,0); |
| 214 |
adjust_fit(0,0); pickup crisp.nib; |
| 215 |
numeric light_hair; light_hair=if hefty: vair else: hair fi; |
| 216 |
pos1(light_hair,0); pos2(light_hair,180); pos3(light_hair,0); x1=x2=x3; |
| 217 |
pos4(.25[light_hair,curve],60); pos5(curve,0); |
| 218 |
lft x1l=hround u; x4=.5w; rt x5r=hround(w-u); |
| 219 |
top y1=h; bot y3=-o; top y4=x_height+o; |
| 220 |
y2=y4-.2x_height; y5=3/4x_height; |
| 221 |
filldraw stroke z1e--z3e; % stem |
| 222 |
filldraw stroke z2e{up}...z4e{right}...z5e{down} |
| 223 |
...{2(x3-x5e),y3-y5e}z3e; % bowl |
| 224 |
penlabels(1,2,3,4,5); endchar; |
| 225 |
|
| 226 |
cmchar "Musical natural sign"; |
| 227 |
beginchar(oct"134",7u#,asc_height#,desc_depth#); |
| 228 |
adjust_fit(0,0); pickup crisp.nib; |
| 229 |
numeric light_hair; light_hair=if hefty: vair else: hair fi; |
| 230 |
pos1(light_hair,0); pos2(curve,90); pos3(curve,90); |
| 231 |
pos4(curve,90); pos5(curve,90); pos6(light_hair,0); |
| 232 |
rt x1r=hround 15/8u; x2=x4=x1l; x3=x5=x6r=w-x2; |
| 233 |
y1=h+o; top y2r=0; .5[y2,y3]=0; y4-y2=y5-y3=x_height; bot y6=-d-o; |
| 234 |
x2'=x1r; z2'=whatever[z2r,z3r]; x5'=x6l; z5'=whatever[z4l,z5l]; |
| 235 |
(x1r,y)=z1l+whatever*(z5-z4); y6l:=y6l-(y-y1r); y1r:=y; |
| 236 |
filldraw z1l--z2l--z3l--z3r--z2'--z1r--cycle; % left stem and lower bar |
| 237 |
filldraw z6r--z5r--z4r--z4l--z5'--z6l--cycle; % right stem and upper bar |
| 238 |
penlabels(1,2,3,4,5,6); endchar; |
| 239 |
|
| 240 |
cmchar "Musical sharp sign"; |
| 241 |
beginchar(oct"135",7u#,asc_height#,desc_depth#); |
| 242 |
adjust_fit(0,0); pickup crisp.nib; |
| 243 |
numeric light_hair; light_hair=if hefty: vair else: hair fi; |
| 244 |
pos1(curve,90); pos2(curve,90); pos3(curve,90); pos4(curve,90); |
| 245 |
lft x1=lft x3=hround u; x2=x4=w-x1; |
| 246 |
top y3r=0; .5[y3,y4]=0; y1-y3=y2-y4=x_height; |
| 247 |
filldraw stroke z1e--z2e; filldraw stroke z3e--z4e; % bars |
| 248 |
numeric theta,hstem; theta=angle(z2-z1); |
| 249 |
(hstem-crisp)*cosd theta=light_hair-crisp; |
| 250 |
pos5(hstem,theta); pos6(hstem,theta); pos7(hstem,theta); pos8(hstem,theta); |
| 251 |
lft x5l=lft x6l=hround(2u-.5light_hair); x7=x8=w-x6; |
| 252 |
top y7l=h+o; bot y6r=-d-o; z7-z5=z8-z6=(whatever,0) rotated theta; |
| 253 |
filldraw stroke z5e--z6e; filldraw stroke z7e--z8e; % stems |
| 254 |
penlabels(1,2,3,4,5,6,7,8); endchar; |
| 255 |
|
| 256 |
% Slurs edited to use light_hair at the ends |
| 257 |
% and to have cutoff rather than rounded ends |
| 258 |
cmchar "Slur below (smile)"; |
| 259 |
beginchar(oct"136",18u#,v_center(.5x_height#)); |
| 260 |
adjust_fit(0,0); pickup fine.nib; |
| 261 |
numeric light_stem; light_stem=Vround .5[vair,stem]; |
| 262 |
numeric light_hair; light_hair=if hefty: vair else: hair fi; |
| 263 |
x1-.5light_hair=hround u; y1+.5light_hair=vround(h+.5light_hair); |
| 264 |
x3=w-x1; y3=y1; |
| 265 |
pos2(light_stem,90); x2=.5w; y2l=good.y -d; |
| 266 |
numeric theta; theta=angle((z2-z1)yscaled 3); |
| 267 |
pos1(light_hair,90+theta); pos3(light_hair,90-theta); |
| 268 |
filldraw z1l{dir theta}...z2l...{dir-theta}z3l |
| 269 |
if serifs: .. else: -- fi |
| 270 |
z3r{-dir-theta}...z2r...{-dir theta}z1r |
| 271 |
if serifs: .. else: -- fi |
| 272 |
cycle; % arc |
| 273 |
penlabels(1,2,3); endchar; |
| 274 |
|
| 275 |
cmchar "Slur above (frown)"; |
| 276 |
beginchar(oct"137",18u#,v_center(.5x_height#)); |
| 277 |
adjust_fit(0,0); pickup fine.nib; |
| 278 |
numeric light_stem; light_stem=Vround .5[vair,stem]; |
| 279 |
numeric light_hair; light_hair=if hefty: vair else: hair fi; |
| 280 |
x1-.5light_hair=hround u; y1-.5light_hair=vround(-d-.5light_hair); |
| 281 |
x3=w-x1; y3=y1; |
| 282 |
pos2(light_stem,90); x2=.5w; y2=good.y h; |
| 283 |
numeric theta; theta=angle((z2-z1)yscaled 3); |
| 284 |
pos1(light_hair,90+theta); pos3(light_hair,90-theta); |
| 285 |
filldraw z1l{dir theta}...z2l...{dir-theta}z3l |
| 286 |
if serifs: .. else: -- fi |
| 287 |
z3r{-dir-theta}...z2r...{-dir theta}z1r |
| 288 |
if serifs: .. else: -- fi |
| 289 |
cycle; % arc |
| 290 |
penlabels(1,2,3); endchar; |