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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
|
% $Header: tmathit.mf,v 1.1 88/01/15 13:15:08 simpson Rel $
% $Log: tmathit.mf,v $
%Revision 1.1 88/01/15 13:15:08 simpson
%initial release
%
%Revision 0.1 87/12/11 19:01:36 simpson
%beta test
%
% The Computer Modern Math Italic family (by D. E. Knuth, 1979--1985)
font_coding_scheme:="TeX math italic";
mode_setup; font_setup;
input tgreekl; % lower case Greek letters
% From file italms.mf, font cmmi10 (output with slant)
cmchar "Lowercase italic script l";
beginchar(oct"044",4.5u#+max(1.5u#,stem#),asc_height#,0);
italcorr .8asc_height#*slant-u#;
adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib;
pos1(hair,-45); pos2(hair,0); pos3(vair,90);
pos4(stem,180); pos5(vair,270); pos6(hair,315);
lft x1l=hround(lft x1l-x1); rt x2r=hround(w-1.5u); x3=.5w;
lft x4r=hround .5u; x5=x3+.75u; x6=x1+w+1;
y1=y6=.125h; y2=.8h; top y3r=h+oo; y4=.5[y3,y5]; bot y5=-oo;
filldraw stroke z1e{10u,asc_height}...z2e{up}...pulled_arc.e(3,4)
& pulled_arc.e(4,5)...z6e{10u,asc_height}; % bowl and hook
math_fit(0,ic#); penlabels(1,2,3,4,5,6); endchar;
font_slant slant;
font_x_height x_height#;
font_quad 18u#+4letter_fit#;
slant:=mono_charic#:=0; % the remaining characters will not be slanted
currenttransform:=identity yscaled aspect_ratio scaled granularity;
input titalms; % special symbols for math italic
input tgreeku; % upper case greek letters
input tromms; % roman math specials
% The following characters come from a hodge-podge of files.
% My own creation (created in just 1 hour!)
cmchar "Right hand";
beginchar(oct"004", 2.1body_height#, body_height#, 0);
adjust_fit(0,0);
picture hand;
% On the graph I drew this on, the hand is 40 units tall and 84 (2.1*40) units
% wide.
handunit# := body_height#/40;
define_pixels(handunit);
z1=(4handunit,0); z2=(handunit,handunit); z3=(0,4handunit);
z4=(0,34handunit); z5=(handunit,36handunit); z6=(4handunit,37handunit);
z7=(9handunit,35handunit); z8=(16handunit,36handunit);
z9=(30handunit,38handunit); z10=(50handunit,40handunit);
z11=(70handunit,40handunit); z12=(78handunit,40handunit);
z13=(84handunit,38handunit); z14=(83handunit,34handunit);
z15=(80handunit,33handunit); z16=(56handunit,30handunit);
z17=(52handunit,29handunit); z18=(51handunit,24handunit);
z19=(46handunit,18handunit); z20=(45handunit,14handunit);
z21=(40handunit,8handunit); z22=(37handunit,handunit);
z23=(35handunit,0); z24=(27handunit,handunit); z25=(13handunit,2handunit);
fill z1{dir 180}..z2{z3-z1}..{dir 90}z3--z4{dir 90}..z5{z6-z4}..z6{dir 0}
..z7{dir 0}..z8..z9..z10..z11{dir 0}--z12{dir 0}..z13{dir -80}..z14{dir 225}
..z15{dir 190}--z16..{dir 200}z17 & flex(z17,z18,z19) & flex(z19,z20,z21)
..z22{dir 225}..z23{dir 180}..z24{z25-z23}..z25..cycle;
hand:=currentpicture;
endchar;
% My own creation
cmchar "Left hand";
beginchar(oct"036", 2.1body_height#, body_height#, 0);
adjust_fit(0,0);
currentpicture:=hand reflectedabout ((.5w,0),(.5w,h));
endchar;
% From font cmsy10, file symbol.mf
cmchar "Subset or equal to sign";
compute_spread(.45x_height#,.55x_height#);
spread#':=spread#; spread':=spread; % the spread of `$=$'
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"133",14u#,v_center(spread#'+spread#+rule_thickness#));
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]; top y1=h;
x4=x5=.5w; y4=y1; y5=y3;
draw z1---z4...z2{down}...z5---z3; % arc and bars
x8=x1; lft x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % lower bar
labels(1,2,3,4,5,8,9); endchar;
% From font cmsy10, file symbol.mf
cmchar "Superset or equal to sign";
compute_spread(.45x_height#,.55x_height#);
spread#':=spread#; spread':=spread; % the spread of `$=$'
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"002",14u#,v_center(spread#'+spread#+rule_thickness#));
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
y1-y3=spread; y2=.5[y1,y3]; top y1=h;
x4=x5=.5w; y4=y1; y5=y3;
draw z1---z4...z2{down}...z5---z3; % arc and bars
x8=x1; rt x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % lower bar
labels(1,2,3,4,5,8,9); endchar;
% From font cmsy10, file symbol.mf
cmchar "Times operator";
beginarithchar(oct"052"); pickup rule.nib;
x1=good.x(1/sqrt2)[.5w,rt u]; y1=good.y(1/sqrt2)[math_axis,bot h];
x2=x3=w-x1; x4=x1; .5[y1,y2]=.5[y3,y4]=math_axis; y2=y4;
draw z1--z2; draw z3--z4; % diagonals
labels(1,2,3,4); endchar;
% From font cmsy10, file symbol.mf
cmchar "Asterisk at the axis";
beginchar(oct"071",9u#,v_center(x_height#));
adjust_fit(0,0);
numeric ast_flare; ast_flare=hround .7[thin_join,stem];
x0=.5w; y0=h-.5x_height;
for d=-150 step 60 until 150: z[d]=z0+.5dir d xscaled 7.5u yscaled x_height;
numeric theta; theta=angle(z[d]-z0);
fill z0+.5(0,-thin_join)rotated theta
---z[d]+.5(-ast_flare,-ast_flare)rotated theta
..z[d]..z[d]+.5(-ast_flare,ast_flare)rotated theta
---z0+.5(0,thin_join)rotated theta--cycle; endfor % diagonal at angle |d|
labels(0,[-150],[-90],[-30],30,90,150); endchar;
% From font cmsy10, file symbol.mf
cmchar "Elementary division operator";
beginarithchar(oct"057"); pickup rule.nib;
x3-.5dot_size=hround(.5w-.5dot_size); w:=r:=2x3;
y3+.5dot_size=vround(math_axis+math_spread[.5x_height,.6x_height]+.5dot_size);
lft x1=hround u-eps; x2=w-x1; y1=y2=math_axis;
draw z1--z2; % bar
pos3(dot_size,0); pos4(dot_size,90); z3=z4;
pos5(dot_size,0); pos6(dot_size,90); z5=z6; x5=x3; .5[y3,y5]=math_axis;
dot(3,4); dot(5,6); % dots
penlabels(1,2,3,4,5,6); endchar;
% From font cmsy10, file symbol.mf
cmchar "Similarity sign";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"062",14u#,v_center(spread#+rule_thickness#));
adjust_fit(0,0);
pickup pencircle xscaled .7rule_thickness yscaled 1.4rule_thickness;
if vair#>.8curve#: pickup rule.nib; autorounded; fi % monoline
lft x1=hround u; x2=4u; x3=w-x2; x4=w-x1;
bot y1=bot y3=-d; top y2=top y4=h;
draw z1{up}...z2{right}..{right}z3...{up}z4; % stroke
labels(1,2,3,4); endchar;
% From font cmsy10, file symbol.mf
cmchar "Similar or equal sign";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"061",14u#,v_center(2spread#+rule_thickness#));
adjust_fit(0,0);
pickup pencircle xscaled .7rule_thickness yscaled 1.4rule_thickness;
if vair#>.8curve#: pickup rule.nib; autorounded; fi % monoline
lft x1=hround u; x2=4u; x3=w-x2; x4=w-x1;
bot y1=bot y3=floor math_axis; top y2=top y4=h;
draw z1{up}...z2{right}..{right}z3...{up}z4; % stroke
pickup rule.nib; lft x5=hround u-eps; x6=w-x5; y5=y6=math_axis-spread;
draw z5--z6; % bar
labels(1,2,3,4,5,6); endchar;
% From font cmsy10, file symbol.mf
cmchar "Proportionality sign";
beginchar(oct"003",16.5u#,x_height#,0);
italcorr x_height#*slant-.5u#;
adjust_fit(0,-2.5u#); pickup fine.nib;
numeric theta,phi; phi=angle(3u,h); theta=angle(5u,-h);
pos1(vair,180); pos2(.5[vair,stem],90+.5theta); pos3(stem,90+theta);
pos4(stem,90+theta); pos5(.5[vair,stem],90+.5theta);
pos6(vair,180); pos7(.2[vair,stem],270+.5phi);
pos8(.3[vair,stem],270+phi); pos9(.2[vair,stem],270+.5phi);
lft x1r=w-rt x6l=hround u; x2=x9=.4[x1,x8]; x5=x7=.6[x8,x6];
if monospace: x2l:=x2r; x5r:=x5l; x7r:=x7l; x9l:=x9r; fi
y1=y6=.5h; top y2r=top y7l=h+oo; bot y5l=bot y9r=-oo;
x8=.5[x3,x4]=.5w; y8=.5[y3,y4]=.5h;
y3-y4=h/3; z3-z4=whatever*dir theta;
filldraw stroke z1e{up}...z2e{right}...z3e---z4e...z5e{right}...z6e{up}
...z7e{left}...{-dir phi}z8e...{left}z9e...z1e{up}; % `infinity' bowls
erase fill (w-3.5u,h+o)--(w,h+o)
--(w,-o)--(w-3.5u,-o)--cycle; % erase excess
penlabels(1,2,3,4,5,6,7,8,9); endchar;
% From font cmsy10, file symbol.mf
cmchar "Empty set symbol";
beginchar(oct"172",9u#,body_height#,body_height#-asc_height#);
adjust_fit(0,0);
penpos1(vair,90); penpos3(vair,-90); penpos2(stem,180); penpos4(stem,0);
if not monospace: interim superness:=sqrt(more_super*hein_super); fi
x2r=hround max(.7u,1.45u-.5stem);
x4r=w-x2r; x1=x3=.5w; y1r=asc_height+o; y3r=-o;
y2=y4=.5asc_height-vair_corr; y2l:=y4l:=.52asc_height;
penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
& pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle; % bowl
pickup rule.nib; lft x6=hround 2u-eps; x5=w-x6; top y5=h+o; bot y6=-d-o;
draw z5--z6; % diagonal
penlabels(1,2,3,4,5,6); endchar;
% From font cmsy10, file symbol.mf
cmchar "Nabla or backwards-difference operator";
beginchar(oct"050",15u#,cap_height#,0);
adjust_fit(0,0);
numeric right_stem,alpha;
right_stem=cap_hair if hefty: -3stem_corr fi;
x1l=w-x4r=.75u; y1=y4=h;
x2-x1=x4-x3; x3l=x2l+apex_corr; y2=y3=-apex_o-apex_oo;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*cap_stem,0); penpos2(alpha*cap_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
fill diag_end(2l,1l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)--cycle; % triangle
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
y5=y6=h-cap_vstem; z5=whatever[z1r,z2r]; z6=whatever[z3l,z4l];
if y0>cap_notch_cut: y0:=cap_notch_cut;
unfill z0+.5right{up}...{z4-z3}z6--z5{z2-z1}
...{down}z0+.5left--cycle; % counter
else: unfill z0--z5--z6--cycle; fi % counter
penlabels(0,1,2,3,4,5,6); endchar;
% From font cmsy10, file symbol.mf
cmchar "Section sign";
beginchar(oct"070",6.5u#+max(1.5u#,stem#),asc_height#,desc_depth#);
adjust_fit(0,0); pickup fine.nib;
numeric sstem; sstem=hround .75[hair,stem];
pos0(stem,0); pos1(hair,0); pos2(vair,90); pos3(sstem,180); pos4(vair,270);
pos5'(sstem,0); pos5(sstem,180);
pos6(vair,90); pos7(sstem,0); pos8(vair,-90); pos9(hair,-180); pos10(stem,-180);
top y2r=h+oo; bot y8r=-d-oo; y2-y1=y9-y8=(y2-y8)/8;
y3=.52[y4,y2]; y5=.52[y4,y6]; y7=.52[y6,y8]; y5'=.52[y6,y4];
y2-y4=y4-y6=y6-y8;
rt x1r=hround(w-1.5u); lft x3r=hround 1.25u;
x2=x4=x6=x8=.5w; x5=x7=w-x3; x5'=x3; x9=w-x1;
bulb(2,1,0); bulb(8,9,10); % bulbs
filldraw stroke z2e{left}...z3e{down}...z4e{3(x5-x3),y5-y3}
...z5e{down}...{left}z6e; % upper stroke
filldraw stroke z4e{left}...z5'e{down}...z6e{3(x7-x5'),y7-y5'}
...z7e{down}...{left}z8e; % upper stroke
penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
% From font cmsy10, file symbol.mf
cmchar "Double dagger mark";
beginchar(oct"131",8u#,asc_height#,desc_depth#);
adjust_fit(0,0); pickup fine.nib;
pos1(stem,0); pos2(thin_join,0); pos3(stem,0);
pos4(stem,90); pos2'(thin_join,90); pos5(stem,90); z2'=z2;
x1=x2=x3; x1-.5stem=hround(.5w-.5stem); w:=r:=2x1;
x4-.5stem=hround u; x5=w-x4;
y1+.5stem=h+oo; y2=y4=y5=.5[y1,y3]; y3-.5stem=ceiling(.5[-d,h]);
filldraw circ_stroke z1e{down}..{down}z2e; % top stem
filldraw circ_stroke z3e{up}..{up}z2e; % upper middle stem
filldraw circ_stroke z4e{right}..{right}z2'e; % top left bulb
filldraw circ_stroke z5e{left}..{left}z2'e; % top right bulb
pos6(stem,0); pos7(thin_join,0); pos8(stem,0);
pos9(stem,90); pos7'(thin_join,90); pos0(stem,90); z7'=z7;
x6=x7=x8=x1; x9=x4; x0=x5;
y6=y3-stem-1; y7=y9=y0=.5[y6,y8]; y8-.5stem=-d-oo;
filldraw circ_stroke z6e{down}..{down}z7e; % lower middle stem
filldraw circ_stroke z8e{up}..{up}z7e; % bottom stem
filldraw circ_stroke z9e{right}..{right}z7'e; % bottom left bulb
filldraw circ_stroke z0e{left}..{left}z7'e; % bottom right bulb
penlabels(1,2,3,4,5,6,7,8,9,0); endchar;
% From font cmsy10, file sym.mf
cmchar "Minus";
beginarithchar(oct"055"); pickup rule.nib;
lft x1=hround 1.5u-eps; x2=w-x1; y1=y2=math_axis;
draw z1--z2; % bar
labels(1,2); endchar;
% From font cmsy10, file sym.mf
cmchar "Plus-or-minus sign";
beginarithchar(oct"010"); pickup rule.nib;
numeric shiftup; shiftup=vround 1.5u;
x1=x2=.5w; lft x3=lft=x5=hround u-eps; x4=x6=w-x3;
.5[y1,y2]=y3=y4=math_axis+shiftup; top y1=h+shiftup; y5=y6=y2;
draw z1--z2; % stem
draw z3--z4; % plus bar
draw z5--z6; % minus bar
labels(1,2,3,4,5,6); endchar;
% From font cmsy10, file sym.mf
cmchar "Downward arrow";
beginchar(oct"067",9u#,asc_height#,asc_depth#);
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(bar,90); pos4(bar,90);
lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
x0=x1=x2; bot y0=-d; x0-x3=x4-x0=3u+eps;
y3=y4=y0+.24asc_height+eps;
pos5(bar,angle(z4-z0)); z5l=z0;
pos6(bar,angle(z3-z0)); z6l=z0;
z9=.381966[.5[z3,z4],z0];
numeric t; path p; p=z4r{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
--z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3r{z9-z3}..z5r)
--z3l{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Upward arrow";
beginchar(oct"066",9u#,asc_height#,asc_depth#);
italcorr .76asc_height#*slant+.5crisp#-u#;
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(bar,90); pos4(bar,90);
lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=-d;
x0=x1=x2; top y0=h; x0-x3=x4-x0=3u+eps;
y3=y4=y0-.24asc_height-eps;
pos5(bar,angle(z4-z0)); z5l=z0;
pos6(bar,angle(z3-z0)); z6l=z0;
z9=.381966[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
--z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3l{z9-z3}..z5r)
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Leftward arrow";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"064",18u#,v_center(spread#+rule_thickness#));
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,90); pos2(rule_thickness,90); pos3(bar,0); pos4(bar,0);
y0=y1=y2=math_axis; x1+.5rule_thickness=hround(w-u); lft x0=hround u;
y3-y0=y0-y4=.24asc_height+eps; x3=x4=x0+3u+eps;
pos5(bar,angle(z4-z0)); z5l=z0; pos6(bar,angle(z3-z0)); z6l=z0;
z9=.381966[.5[z3,z4],z0];
numeric t; path p; p=z4r{z9-z4}..z6r;
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
--z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3r{z9-z3}..z5r)
--z3l{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Rightward arrow";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"065",18u#,v_center(spread#+rule_thickness#));
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,90); pos2(rule_thickness,90); pos3(bar,0); pos4(bar,0);
y0=y1=y2=math_axis; x1-.5rule_thickness=hround u; rt x0=hround(w-u);
y3-y0=y0-y4=.24asc_height+eps; x3=x4=x0-3u-eps;
pos5(bar,angle(z4-z0)); z5l=z0; pos6(bar,angle(z3-z0)); z6l=z0;
z9=.381966[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
--z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3l{z9-z3}..z5r)
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Proper subset sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"032",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
x4=x5=.5w; y4=y1; y5=y3;
draw z1---z4...z2{down}...z5---z3; % arc and bars
labels(1,2,3,4,5); endchar;
% From font cmsy10, file sym.mf
cmchar "Proper superset sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"033",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
x4=x5=.5w; y4=y1; y5=y3;
draw z1---z4...z2{down}...z5---z3; % arc and bars
labels(1,2,3,4,5); endchar;
% From font cmsy10, file sym.mf
cmchar "Element sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"037",12u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x2=hround 1.5u-eps; x1=x3=x6=w-x2;
y1-y3=spread; y2=y6=.5[y1,y3]=math_axis;
x4=x5=.5w+u; y4=y1; y5=y3;
draw z1---z4...z2{down}...z5---z3; % arc and bars
draw z2--z6; % middle bar
labels(1,2,3,4,5,6); endchar;
% From font cmsy10, file sym.mf
cmchar "Logical not sign";
beginchar(oct"035",12u#,x_height#,0);
italcorr x_height#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; x2=x3=w-x1;
y1=y2=good.y .5[bar_height,h]; y2-y3=1.2(h-bar_height);
draw z1--z2--z3; % bar and stem
labels(1,2,3); endchar;
% From font cmsy10, file sym.mf
cmchar "Less than sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"074",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3; % diagonals
labels(1,2,3); endchar;
% From font cmsy10, file sym.mf
cmchar "Greater than sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"076",14u#,v_center(spread#+rule_thickness#));
italcorr math_axis#*slant-u#;
adjust_fit(0,0); pickup rule.nib;
rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3; % diagonals
labels(1,2,3); endchar;
% From font cmsy10, file sym.mf
cmchar "Unequals sign";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"063",14u#,v_center(4spread#+rule_thickness#));
italcorr h#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; x3=x1; x2=x4=w-x1;
y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis;
draw z1--z2; draw z3--z4; % bars
lft x6=hround 3.5u-eps; x5=w-x6; top y5=h+o; bot y6=-d-o;
draw z5--z6; % diagonal
labels(1,2,3,4,5,6); endchar;
% From font cmsy10, file sym.mf
cmchar "Less than or equal to sign";
compute_spread(.45x_height#,.55x_height#);
spread#':=spread#; spread':=spread; % the spread of `$=$'
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"011",14u#,v_center(spread#'+spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]; top y1=h;
draw z1--z2--z3; % diagonals
x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % bar
labels(1,2,3,8,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Greater than or equal to sign";
compute_spread(.45x_height#,.55x_height#);
spread#':=spread#; spread':=spread; % the spread of `$=$'
compute_spread(5/4x_height#,3/2x_height#);
beginchar(oct"012",14u#,v_center(spread#'+spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
y1-y3=spread; y2=.5[y1,y3]; top y1=h;
draw z1--z2--z3; % diagonals
x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % bar
labels(1,2,3,8,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Equivalence or congruence sign";
compute_spread(.45x_height#,.55x_height#);
beginchar(oct"060",14u#,v_center(2spread#+rule_thickness#));
italcorr h#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; x3=x5=x1; x2=x4=x6=w-x1;
y1=y2; y3=y4=math_axis; y5=y6; y1-y3=y3-y5=spread;
draw z1--z2; % upper bar
draw z3--z4; % middle bar
draw z5--z6; % lower bar
labels(1,2,3,4,5,6); endchar;
% From font cmsy10, file sym.mf
cmchar "Reverse slash (backslash)";
beginchar(oct"134",9u#,body_height#,paren_depth#);
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; top y1=h+eps;
rt x2=hround(w-u)+eps; bot y2=-d-eps;
draw z1--z2; % diagonal
labels(1,2); endchar;
% From font cmsy10, file sym.mf
cmchar "Vertical line";
beginchar(oct"174",5u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0); pickup rule.nib;
x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps;
draw z1--z2; % stem
labels(1,2); endchar;
% From font cmsy10, file sym.mf
cmchar "Left curly brace";
beginchar(oct"173",9u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1l{left}...z2l---z3l...{left}z4l
--z4'l{right}...z5l---z6l...{right}z7l
--z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right}
...z3r---z2r...{right}z1'r--z1r--cycle; % stroke
penlabels(1,2,3,4,5,6,7); endchar;
% From font cmsy10, file sym.mf
cmchar "Right curly brace";
beginchar(oct"175",9u#,body_height#,paren_depth#);
italcorr math_axis#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1r{right}...z2r---z3r...{right}z4r
--z4'r{left}...z5r---z6r...{left}z7r
--z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left}
...z3l---z2l...{left}z1'l--z1l--cycle; % stroke
penlabels(1,2,3,4,5,6,7); endchar;
% From font cmsy10, file sym.mf
cmchar "Straight double quotes";
beginchar(oct"042",9u#,asc_height#,0);
numeric top_width#,spread#; top_width#=if serifs: flare# else: stem# fi;
spread#=max(3u#,top_width#+.5u#); define_pixels(spread);
italcorr asc_height#*slant+.5top_width#+.5spread#-4u#;
adjust_fit(0,0);
x1=x2; x3=x4=w-x1; x3-x1=spread+2; y1=y3;
y2=y4=max(.5[bar_height,x_height]+.5vair,h-x_height);
if serifs: pickup crisp.nib; pos1(flare,0); pos2(vair,0);
pos3(flare,0); pos4(vair,0);
y1+.5stem=h; filldraw circ_stroke z1e--z2e; % left stem and bulb
filldraw circ_stroke z3e--z4e; % right stem and bulb
else: pickup fine.nib; pos1(stem,0); pos2(vair,0);
pos3(stem,0); pos4(vair,0);
top y1=h; filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; fi % right stem
penlabels(1,2,3,4); endchar;
% From font cmsy10, file sym.mf
cmchar "Infinity";
beginchar(oct"001",18u#,x_height#,0);
italcorr .7x_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
numeric theta,phi;
if monospace: phi=-theta=90;
else: phi=angle(4u,h); theta=angle(6u,-h); fi
pos1(vair,180); pos2(.5[vair,curve],90+.5theta); pos3(curve,90+theta);
pos4(curve,90+theta); pos5(.5[vair,curve],90+.5theta);
pos6(vair,180); pos7(.2[vair,curve],270+.5phi);
pos8(.3[vair,curve],270+phi); pos9(.2[vair,curve],270+.5phi);
lft x1r=w-rt x6l=hround u; x2=x9=.4[x1,x8]; x5=x7=.6[x8,x6];
if monospace: x2l:=x2r; x5r:=x5l; x7r:=x7l; x9l:=x9r; fi
y1=y6=.5h; top y2r=top y7l=h+oo; bot y5l=bot y9r=-oo;
x8=.5[x3,x4]=.5w; y8=.5[y3,y4]=.5h;
y3-y4=h/3; z3-z4=whatever*dir theta;
filldraw stroke z1e{up}...z2e{right}...z3e---z4e...z5e{right}
...z6e{up}...z7e{left}...{-dir phi}z8e...{left}z9e...z1e{up}; % bowls
penlabels(1,2,3,4,5,6,7,8,9); endchar;
% From font cmsy10, file sym.mf
cmchar "Set union sign";
beginchar(oct"005",12u#,.8asc_height#,0);
italcorr .8asc_height#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
y1=good.y h+o; bot y3=-o; y2=y4=2/3[y1,y3]; y5=y1;
draw z1---z2...z3...z4---z5; % stems and cup
labels(1,2,3,4,5); endchar;
% From font cmsy10, file sym.mf
cmchar "Set intersection sign";
beginchar(oct"034",12u#,.8asc_height#,0);
italcorr .8asc_height#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib; autorounded;
lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
y3=good.y h+o; bot y1=-o; y2=y4=2/3[y1,y3]; y5=y1;
draw z1---z2...z3...z4---z5; % stems and cap
labels(1,2,3,4,5); endchar;
% My own creation
cmchar "Square root extender";
beginchar(oct"006",12u#,14u#,0);
adjust_fit(0,0); pickup rule.nib;
bot lft z1=(0,h); bot rt z2=(w+2u,h); draw z1--z2;
penlabels(1,2);
endchar;
% From font cmsy10, file symbol.mf (hacked up to be above baseline)
cmchar "Radical sign";
beginchar(oct"013",15u#,14u#,2u#);
adjust_fit(0,-letter_fit#); pickup rule.nib;
x1=good.x 4/9w; x2=good.x(w+.5); bot y1=-2u; bot y2=14u;
draw z1--z2; % diagonal
pickup crisp.nib; pos3(max(curve,rule_thickness),0);
x3l=1.5[x2,x1]; y3=.5[y1,y2];
pos4(rule_thickness,0); x4=x1; bot y4=-2u;
pos5(vair,-45); x5l=good.x(x3l-u); z5l=whatever[z3r,z2];
z6=z5r+whatever*(z2-z3r)=whatever[z3l,z4l];
z7=whatever[z1,z2]=z3r+whatever*(z4l-z3l);
filldraw z5r--z6--z4l--z4--z7--z3r--z5l--cycle; % left diagonal and serif
penlabels(1,2,3,4,5,6,7);
endchar;
% The following TRW logo is designed by Mike Urban and put in the Bell
% System logo position. The Bell System logo is not even used by AT&T
% anymore and I work for TRW---so there. There is some perverse
% appropriateness in having the escape sequence \(bs.
def fixpt(expr pta,ptb,theta)=
if known xpart pta:
((ypart pta)-(ypart ptb))/((xpart pta)-(xpart ptb))=
(sind theta)/(cosd theta);
else:
((xpart pta)-(xpart ptb))/((ypart pta)-(ypart ptb))=
(cosd theta)/(sind theta);
fi;
enddef;
def over(expr pta,ptb,delta)=
xpart pta = (xpart ptb)+(delta/cosd 20);
enddef;
input logodesign;
a#:=cap_height#/3.91;
define_pixels(a);
beginchar(oct"007", 12.82a#, 3.91a#, 0);
LOGO;
endchar;
% From the font cmsy10, file sym.mf
cmchar "Integral sign";
beginchar(oct"015",5.25u#+max(1.25u#,stem#)+2max(1.5u#,curve#),
asc_height#,desc_depth#);
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(curve,0); pos2(hair,0); pos3(vair,90); pos4(.6[hair,stem],180);
pos5(stem,180); pos5'(stem,0); z5'=z5; pos6(.6[hair,stem],0);
pos7(vair,-90); pos8(hair,-180); pos9(curve,-180);
x7=w-x3=2.4u; rt x1r=max(rt x3+eps,hround(w-u)); x9=w-x1;
x5=.5[x4,x6]; x4-x6=1.5u; lft x5r=hround(.5w-.5stem);
y9-.5curve=vround(-.9d-o+vair); y3-y1=y9-y7;
top y3r=h+o; bot y7r=-d-o; y5=.5[y3,y7]=.5[y4,y6]; y4-y6=2/3(y3-y7);
bulb(3,2,1); bulb(7,8,9); % bulbs
filldraw stroke z3e{left}...z4e{(z5e-z4e)xscaled 1.1}
..tension atleast 1 and atleast .8..{z5-z4}z5e; % upper stem
filldraw stroke z5'e{z6-z5}..tension atleast.8 and atleast 1
..{(z6e-z5'e)xscaled 1.1}z6e...{left}z7e; % lower stem
math_fit(0,-2u#);
% It looks better with troff if we move it over 1 unit to the left
currentpicture:=currentpicture shifted (-1u,0);
penlabels(1,2,3,4,5,6,7,8,9); endchar;
% From the font cmr10, file punct.mf
cmchar "Hash mark (number sign)";
if monospace: compute_spread(.6x_height#,.7x_height#);
else: compute_spread(.45x_height#,.55x_height#); fi
beginchar("#",15u#,asc_height#,asc_depth#);
italcorr (math_axis#+.5(spread#+rule_thickness#))*slant-.5u#;
adjust_fit(0,0);
pickup rule.nib; lft x1=hround u-eps; x3=x1; x2=x4=w-x1;
y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis;
draw z1--z2; % upper bar
draw z3--z4; % lower bar
lft x6=hround 3u; rt x7=hround(w-3u); x5-x6=x7-x8;
x8=good.x if monospace: .6 else: .5 fi\\w;
top y5=top y7=h+eps; bot y6=bot y8=-d-eps;
y15=y1; z15=whatever[z5,z6]; y36=y3; z36=whatever[z5,z6];
y27=y2; z27=whatever[z7,z8]; y48=y4; z48=whatever[z7,z8];
draw z5--if x5>x6+1:(good.x(x15+.5),y1)--(good.x(x15-.5),y1)
--(good.x(x36+.5),y3)--(good.x(x36-.5),y3)--fi\\z6; % left diagonal
draw z7--if x7>x8+1:(good.x(x27+.5),y2)--(good.x(x27-.5),y2)
--(good.x(x48+.5),y4)--(good.x(x48-.5),y4)--fi\\z8; % right diagonal
labels(1,2,3,4,5,6,7,8,15,27,36,48); endchar;
% From font cmr10, file punct.mf
cmchar "Plus sign";
beginarithchar("+"); pickup rule.nib;
x1=x2=good.x .5w; top y1=h+eps; .5[y1,y2]=math_axis;
lft x3=hround u-eps; x4=w-x3; y3=y4=math_axis;
draw z1--z2; % stem
draw z3--z4; % crossbar
labels(1,2,3,4); endchar;
% From font cmr10, file accent.mf
cmchar "Grave accent";
beginchar(oct"140",9u#,min(asc_height#,2x_height#),0);
adjust_fit(0,0);
if serifs: pickup crisp.nib; x1-.5stem=hround 2u; x2=2/3[x1,w-x1];
y1+.5stem=h+eps; y2=max(2/3[h,x_height],x_height+o+hair);
numeric theta; theta=angle(z2-z1)+90;
pos1(stem,theta); pos2(hair,theta);
filldraw circ_stroke z1e--z2e; % diagonal
else: pickup fine.nib; pos1(stem,0); pos2(vair,0);
lft x1l=hround 1.5u; rt x2r=hround(.5w+.25u+.5vair);
top y1=h; bot y2=vround 2/3[h,x_height];
filldraw stroke z1e--z2e; fi % diagonal
penlabels(1,2); endchar;
% From font cmr10, file accent.mf
cmchar "Acute accent";
beginchar(oct"047",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-if serifs: 1.5 fi u#;
adjust_fit(0,0);
if serifs: pickup crisp.nib; x1+.5stem=hround(w-2u); x2=2/3[x1,w-x1];
y1+.5stem=h+eps; y2=max(2/3[h,x_height],x_height+o+hair);
numeric theta; theta=angle(z2-z1)+90;
pos1(stem,theta); pos2(hair,theta);
filldraw circ_stroke z1e--z2e; % diagonal
else: pickup fine.nib; pos1(stem,0); pos2(vair,0);
rt x1r=hround(w-1.5u); lft x2l=hround(.5w-.25u-.5vair);
top y1=h; bot y2=vround 2/3[h,x_height];
filldraw stroke z1e--z2e; fi % diagonal
penlabels(1,2); endchar;
% From font cmr10, file punct.mf
cmchar "Equals sign";
compute_spread(.45x_height#,.55x_height#);
beginchar("=",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; x3=x1; x2=x4=w-x1;
y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis;
draw z1--z2; % upper bar
draw z3--z4; % lower bar
labels(1,2,3,4); endchar;
% From font cmr10, file punct.mf
cmchar "At sign";
beginchar("@",14u#,asc_height#,0);
italcorr .7asc_height#*slant-.5u#;
adjust_fit(0,if hefty or monospace:-2u# else: 0 fi);
pickup fine.nib; pos0(fudged.hair,0); pos1(vair,90);
pos2(fudged.stem,180); pos3(vair,270);
pos4(fudged.stem,-180); pos5(fudged.stem,-180);
pos6(vair,-90); pos7(fudged.hair,0);
pos8(vair,90); pos9(fudged.hair,180);
pos10(vair,270); pos11(.5[vair,flare],360);
x1=x3=.5[x0,x2]; y0=y2=.5[y1,y3];
x8=x10=.5w; y7=y9=.5[y8,y10];
lft x9r=hround u; x7=w-x9; top y8r=h+oo; bot y10r=-oo;
top y1r=vround(.8[y10,y8]+.5vair); bot y3r=vround(.2[y10,y8]-.5vair);
x6l=1/3[x5l,x7l]; y6=y3; y11=good.y(.1[y10,y8]-.5);
x0=x4=x5; y4=.8[y3,y1]; y5=2/3[y7,y6];
if hefty or monospace: lft x2r=hround(5u-.5fudged.stem);
rt x0r=hround(w-3u); x11r=x0r;
else: lft x2r=hround 3.4u; x0=w-x2; x11r=x7r; fi
filldraw stroke super_arc.e(1,2) & super_arc.e(2,3); % left inner bowl
filldraw stroke super_arc.e(3,0) & super_arc.e(0,1); % right inner bowl
filldraw stroke super_arc.e(8,9) & super_arc.e(9,10)
& term.e(10,11,right,1,4); % left outer bowl and terminal
if hefty or monospace: {{interim superness:=hein_super;
filldraw stroke super_arc.e(0,8)}}; % link
else: (x,y6r)=whatever[z6l,z7l]; x6r:=x;
filldraw stroke z4e---z5e...z6e{right}...{up}z7e
& super_arc.e(7,8); fi % stem and link
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
% From font cmr10, file accent.mf
cmchar "Tilde (squiggle) accent";
beginchar(oct"176",9u#,min(asc_height#,10/7x_height#+.5dot_size#),0);
italcorr h#*slant-u#;
adjust_fit(0,0);
if serifs: numeric theta; theta=angle(1/6(6u-vair),1/4(h-x_height));
pickup crisp.nib; numeric mid_width; mid_width=.4[vair,stem];
pos1(vair,theta+90); pos2(vair,theta+90);
pos3(vair,theta+90); pos4(vair,theta+90);
z2-z1=z4-z3=(mid_width-crisp)*dir theta;
lft x1r=w-rt x4l=hround 1.5u; top y4r=h;
bot y1l=vround(bot y1l+min(2/3[x_height,h],y3l-.25vair)-top y1r);
pair delta; ypart delta=3(y3l-y1l); delta=whatever*dir theta;
filldraw z1l..controls(z1l+delta)and(z3l-delta)..z3l..z4l
--z4r..controls(z4r-delta)and(z2r+delta)..z2r..z1r--cycle; % stroke
else: pickup fine.nib; pos1(vair,180); pos2(vair,90);
pos3(.5[vair,slab],90); pos4(vair,90); pos5(vair,180);
lft x1r=w-rt x5l=hround 1.5u; x2-x1=x3-x2=x4-x3=x5-x4;
bot y1=bot y4l=vround(.75[x_height,h]-vair);
top y2r=top y5=h; y3=.5[y2,y4];
filldraw stroke z1e{up}...z2e{right}..z3e..{right}z4e...{up}z5e; fi % stroke
penlabels(1,2,3,4,5); endchar;
% From font cmsy10, file symbol.mf
cmchar "Circle for copyright, etc.";
beginchar(oct"135",18u#,asc_height#,desc_depth#); autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; draw_circle; % circle
labels(1,2,3,4,5,6,7,8); endchar;
% From font cmr10, file accent.mf
cmchar "Circumflex (hat) accent";
beginchar(oct"041",9u#,min(asc_height#,2x_height#),0);
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
adjust_fit(0,0);
pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=h; x2=.5w;
x1=w-x3=good.x 2.25u; y1=y3=.5[x_height,y2];
pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90);
filldraw stroke z1e--z2e--z3e; % diagonals
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
adjust_fit(0,0);
pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3;
pos2(stem,0); top y2=h; x2=.5w; bot y1=bot y3=vround 2/3[h,x_height]-eps;
lft x1l=hround(rt x2r-3.25u-.5vair); % same slope as in the acute accent
z0=whatever[z1r,z2r]=whatever[z2l,z3l];
y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l;
filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi % diagonals
penlabels(0,1,2,3,4); endchar;
% From font cmr10, file accent.mf
cmchar "Circumflex (hat) accent";
beginchar(oct"136",9u#,min(asc_height#,2x_height#),0);
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
adjust_fit(0,0);
pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=h; x2=.5w;
x1=w-x3=good.x 2.25u; y1=y3=.5[x_height,y2];
pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90);
filldraw stroke z1e--z2e--z3e; % diagonals
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
adjust_fit(0,0);
pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3;
pos2(stem,0); top y2=h; x2=.5w; bot y1=bot y3=vround 2/3[h,x_height]-eps;
lft x1l=hround(rt x2r-3.25u-.5vair); % same slope as in the acute accent
z0=whatever[z1r,z2r]=whatever[z2l,z3l];
y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l;
filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi % diagonals
penlabels(0,1,2,3,4); endchar;
% My own creation
cmchar "Box rule";
beginchar(oct"132",1u#,cap_height#+2u#,4.3u#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0); pickup crisp.nib;
pos1(vair,0); pos2(vair,0);
x1=x2=hround 0; y1=h; y2=-d;
filldraw stroke z1e--z2e; % stem
penlabels(1,2); endchar;
% My own creation. Only used by otroff. See note below.
cmchar "Underscore";
beginchar("_",9.4u#,x_height#,.7u#);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric below_baseline; below_baseline#:=4u#;
define_pixels(below_baseline);
pickup crisp.nib; pos1(vair,90); pos2(vair,90);
top y1r=top y2r=vround(-below_baseline); x2=hround(w);
x1=0;
filldraw stroke z1e--z2e; % bar
penlabels(1,2); endchar;
% My own creation (This is only used by ditroff. Ditroff's underscore
% needs to be a frog's hair longer than otroff's.)
cmchar "Underscore";
beginchar(oct"041",9.4u#,x_height#,.7u#);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric below_baseline; below_baseline#:=4u#;
define_pixels(below_baseline);
pickup crisp.nib; pos1(vair,90); pos2(vair,90);
top y1r=top y2r=vround(-below_baseline); x2=hround(w+1u);
x1=0;
filldraw stroke z1e--z2e; % bar
penlabels(1,2); endchar;
% The delimiters are from the font cmex10, file bigdel.mf. I had to hack
% them up extensively though to get them to work with troff. Troff wants
% everything lined up in the center and the widths of the floor and ceiling
% characters are the same as the parentheses.
cmchar "Extensible left bracket---top";
beginchar(oct"022",8u#,cap_height#+2u#,4u#);
adjust_fit(0,0); pickup fine.nib;
pos1(heavy_rule_thickness,0); pos2(heavy_rule_thickness,0);
top y1=h; y2=-d; x1=x2=hround(.5w);
filldraw stroke z1e--z2e; % stem
pos3(heavy_rule_thickness,90); pos4(heavy_rule_thickness,90);
x3=x1l; rt x4=hround(w-.75u+.5heavy_rule_thickness); y3r=y4r=y1;
filldraw stroke z3e--z4e; % upper bar
penlabels(1,2,3,4); endchar;
cmchar "Extensible left bracket---bottom";
beginchar(oct"020",8u#,cap_height#+4u#,2u#);
adjust_fit(0,0); pickup fine.nib;
pos1(heavy_rule_thickness,0); pos2(heavy_rule_thickness,0);
y1=h; bot y2=-d; x1=x2=hround(.5w);
filldraw stroke z1e--z2e; % stem
pos5(heavy_rule_thickness,90); pos6(heavy_rule_thickness,90);
x5=x1l; rt x6=hround(w-.75u+.5heavy_rule_thickness); y5l=y6l=y2;
filldraw stroke z5e--z6e; % lower bar
penlabels(1,2,5,6); endchar;
cmchar "Extensible right bracket---top";
beginchar(oct"023",8u#,cap_height#+2u#,4u#);
adjust_fit(0,0); pickup fine.nib;
pos1(heavy_rule_thickness,0); pos2(heavy_rule_thickness,0);
top y1=h; y2=-d; x1=x2=hround(.5w);
filldraw stroke z1e--z2e; % stem
pos3(heavy_rule_thickness,90); pos4(heavy_rule_thickness,90);
x3=x1r; lft x4=hround(.75u-.5heavy_rule_thickness); y3r=y4r=y1;
filldraw stroke z3e--z4e; % upper bar
penlabels(1,2,3,4); endchar;
cmchar "Extensible right bracket---bottom";
beginchar(oct"021",8u#,cap_height#+4u#,2u#);
adjust_fit(0,0); pickup fine.nib;
pos1(heavy_rule_thickness,0); pos2(heavy_rule_thickness,0);
y1=h; bot y2=-d; x1=x2=hround(.5w);
filldraw stroke z1e--z2e; % stem
pos5(stem,90); pos6(stem,90);
x5=x1r; lft x6=hround(.75u-.5heavy_rule_thickness); y5l=y6l=y2;
filldraw stroke z5e--z6e; % lower bar
penlabels(1,2,5,6); endchar;
cmchar "Extensible left curly brace---middle";
beginchar(oct"030",8u#,cap_height#+4u#,4u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos4(min_breadth,0); pos4'(min_breadth,0);
forsuffixes $=2,3,5,6: pos$(heavy_rule_thickness,0); endfor
lft x4l=lft x4'l=hround(1.5u-.5min_breadth);
x2=x3=x5=x6; x2=hround(.5w);
y2=h; y6=-d; .5[y4,y4']=.5[y2,y6]=.5[y3,y5];
y3-y4=(y2-y6)/4; y4-y4'=min_breadth-fine;
filldraw z2l---z3l...{3(x4l-x3l),y4-y3}z4l
--z4'l{3(x5l-x4l),y5-y4'}...z5l---z6l--z6r---z5r
...{3(x4r-x5r),.5[y4,y4']-y5}.5[z4r,z4'r]{3(x3r-x4r),y3-.5[y4,y4']}
...z3r---z2r--cycle; % stroke
penlabels(2,3,4,5,6); endchar;
cmchar "Extensible right curly brace---middle";
beginchar(oct"031",8u#,cap_height#+4u#,4u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos4(min_breadth,0); pos4'(min_breadth,0);
forsuffixes $=2,3,5,6: pos$(heavy_rule_thickness,0); endfor
rt x4r=rt x4'r=hround(w-1.5u+.5min_breadth);
x2=x3=x5=x6; x2=hround(.5w);
y2=h; y6=-d; .5[y4,y4']=.5[y2,y6]=.5[y3,y5];
y3-y4=(y2-y6)/4; y4-y4'=min_breadth-fine;
filldraw z2r---z3r...{3(x4r-x3r),y4-y3}z4r
--z4'r{3(x5r-x4r),y5-y4'}...z5r---z6r--z6l---z5l
...{3(x4l-x5l),.5[y4,y4']-y5}.5[z4l,z4'l]{3(x3l-x4l),y3-.5[y4,y4']}
...z3l---z2l--cycle; % stroke
penlabels(2,3,4,5,6); endchar;
cmchar "Extension module";
beginchar(oct"017",8u#,cap_height#+4u#,4u#);
adjust_fit(0,0); pickup fine.nib;
numeric max_breadth; max_breadth=bold+2dw;
pos2(heavy_rule_thickness,0); pos2'(heavy_rule_thickness,0);
x2=x2'=hround(.5w); y2=h; y2'=-d;
filldraw stroke z2e--z2'e; % link
penlabels(2,2'); endchar;
cmchar "Extensible left curly brace---top";
beginchar(oct"024",8u#,cap_height#+2u#,4u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos1(min_breadth,0); pos1'(min_breadth,0);
pos2(heavy_rule_thickness,0); pos3(heavy_rule_thickness,0);
rt x1r=rt x1'r=hround(w-1.5u+.5min_breadth);
x2=x3=hround(.5w);
top y1=h; y3=-d; y2=.5[y1,y3]; y1-y1'=min_breadth-fine;
filldraw z1l{3(x2l-x1l),y2-y1}...z2l---z3l
--z3r---z2r...{3(x1r-x2r),y1'-y2}z1'r--z1r--cycle; % stroke
penlabels(1,2,3); endchar;
cmchar "Extensible left curly brace---bottom";
beginchar(oct"025",8u#,cap_height#+4u#,2u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos7(min_breadth,0); pos7'(min_breadth,0);
pos5(heavy_rule_thickness,0); pos6(heavy_rule_thickness,0);
rt x7r=rt x7'r=hround(w-1.5u+.5min_breadth);
x5=x6=hround(.5w);
y5=h; y7=-d; y6=.5[y5,y7]; y7'-y7=min_breadth-fine;
filldraw z5l---z6l...{3(x7l-x6l),y7-y6}z7l
--z7r--z7'r{3(x6r-x7r),y6-y7'}...z6r---z5r--cycle; % stroke
penlabels(5,6,7); endchar;
cmchar "Extensible right curly brace---top";
beginchar(oct"026",8u#,cap_height#+2u#,4u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos1(min_breadth,0); pos1'(min_breadth,0);
pos2(heavy_rule_thickness,0); pos3(heavy_rule_thickness,0);
lft x1l=lft x1'l=hround(1.5u-.5min_breadth);
x2=x3=hround(.5w);
top y1=h; y3=-d; y2=.5[y1,y3]; y1-y1'=min_breadth-fine;
filldraw z1r{3(x2r-x1r),y2-y1}...z2r---z3r
--z3l---z2l...{3(x1l-x2l),y1'-y2}z1'l--z1l--cycle; % stroke
penlabels(1,2,3); endchar;
cmchar "Extensible right curly brace---bottom";
beginchar(oct"027",8u#,cap_height#+4u#,2u#);
adjust_fit(0,0); pickup fine.nib;
numeric min_breadth; min_breadth=hround(rule_thickness+.6dw);
pos7(min_breadth,0); pos7'(min_breadth,0);
pos5(heavy_rule_thickness,0); pos6(heavy_rule_thickness,0);
lft x7l=lft x7'l=hround(1.5u-.5min_breadth);
x5=x6=hround(.5w);
top y5=h; bot y7=-d; y6=.5[y5,y7]; y7'-y7=min_breadth-fine;
filldraw z5r---z6r...{3(x7r-x6r),y7-y6}z7r
--z7l--z7'l{3(x6l-x7l),y6-y7'}...z6l---z5l--cycle; % stroke
penlabels(5,6,7); endchar;
bye.
|