summaryrefslogtreecommitdiff
path: root/fonts/mathabx/source/mathbigs.mf
blob: 63b82899e5a609a9b3bdbab164f77dc0a40ae10e (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
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
% mathematical symbols by Anthony Phan.
% file: mathbigs.mf (large symbols)
% last modification: May 16, 2005.
% Only known charcodes will be generated.

def horizontal_rules_list = 
  0.5[-d, h]-math_axis, 0.5[-d, h]-math_axis+x_height, 
  0.25[-d, h], 0.5[-d, h], 0.75[-d, h] enddef;

% PARAMETERS

text_rth# := 0[0.95stem#, 0.95cap_stem#];
disp_rth# := 0.75[0.95stem#, 0.95cap_stem#];
disp_stem# := 1.25cap_stem#;
disp_hair# := max(rth1#, cap_hair#*(cap_curve#/cap_stem#));
define_whole_blacker_pixels(text_rth, disp_rth, disp_stem, disp_hair);

% SUMMATIONS

def tmp_program(expr lowerstem, sidestem, upperstem, beak, hair, beakjut, lo) =
  pickup crisp.nib;
  top y1 = top y2 = h; bot y5 = bot y6 = -d;
  bot y12 = h-vround upperstem; y12 = y13 = y13';
  bot y14 = bot y15 = h-vround(upperstem+beak);
  top y9 = -d+vround lowerstem; y9 = y9' = y10; 
  top y7 = top y8 = -d+vround(lowerstem+beak);
  y3 = y12; y0 = 0.5[y12, y9];
  rt x6 = w-appr; x6 = x7 = x15 = x1+hround beakjut;
  lft x2 = appr; x2 = x3; rt x5 = appr-hround lo;
  rt x7-lft x8 = rt x15- lft x14 = hround hair;
  x0 = floor(0.5[x2, x7])+0.5;
  x9 = x13 = 0.5[x0, x14]; x9' = x8; z13'-z14 = whatever*(z1-z15);
  adjust_slanted_bar(3, 0, 3', 0', max(.5(sidestem-crisp), 1), 1);
  z11-z0 = z0-z0'; z12 = whatever[z3+2(z3'-z3), z11];
  adjust_slanted_bar(5, 11, 5', 11', max(hair-crisp, 1), -1);
  z10 = whatever[z11, z5'];
  z4 = whatever[z5', z11']; z4 = whatever[z3, z0'];
  filldraw z1--z2--z3--z4--z5--z6--z7--z8{down}
  ...beak_darkness[z9', 0.5[z8, z9]]...z9{left}
  --z10--z11--z12--z13{right}
  ...beak_darkness[z13', 0.5[z13, z14]]...z14{z15-z1}
  --z15--cycle;
  labels(0, 0', 1, 2, 3, 3', 4, 5, 5', 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
enddef;

beginchar(small_summation_sign, 8u#+2appr#, 0.8asc_height#, 0);
  "Small summation sign";
  tmp_program(stem, stem, hair, 0.36h-stem, hair, 0.2u, 0.5u);
endchar;

beginchar(summation_sign, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle summation sign";
  tmp_program(cap_stem, cap_stem, cap_hair, 0.333d-d/9,
    cap_hair, 0.4u, 5/7u);
endchar;

beginchar(Summation_sign, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle summation sign";
  tmp_program(disp_stem, disp_stem, disp_hair, 0.333d-d/9,
    disp_hair, 0.75u, u);

endchar;

% PRODUCTS AND COPRODUCTS

def tmp_program(expr orientation, appr_corr, 
    stem, hair, jut, inner_jut, bracket, dish) = 
  if orientation = up: top y1 = top y3 = h; bot y2 = bot y4 = -d;
  else: top y2 = top y4 = h; bot y1 = bot y3 = -d; fi
  pos1(hround stem, 0); pos2(hround stem, 0);
  pos3(hround stem, 0); pos4(hround stem, 0);
  lft x1l = lft x2l = appr+hround(appr_corr+jut);
  rt x3r = rt x4r = w-appr-hround(appr_corr+jut);
  serif(1, 2, bracket, jut, hair, false, dish, 0, hair, true, 0);
  serif(2, 1, bracket, jut, hair, true, dish, inner_jut, hair, true, dish);
  serif(3, 4, bracket, 0, hair, false, 0, jut, hair, true, dish);
  serif(4, 3, bracket, inner_jut, hair, true, dish, jut, hair, true, dish);
  filldraw stroke z1e..z2e; filldraw stroke z3e..z4e;
  filldraw z1f--z3c--z3d--z1e--cycle;
  penlabels(1, 2, 3, 4);
enddef;

beginchar(small_product_sign, 8u#+2appr#, 0.8asc_height#, 0);
  "Small product sign";
  pickup crisp.nib;
  tmp_program(up, -0.875u, stem, hair, u, u, 0.5u, dish);
endchar;

beginchar(product_sign, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle product sign";
  pickup crisp.nib;
  tmp_program(up, 0, cap_stem, cap_hair, 1.8u, 1.8u, 0.9u, dish);
endchar;

beginchar(Product_sign, 21u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle product sign";
  pickup crisp.nib;
  tmp_program(up, 0, disp_stem, disp_hair, 2.4u, 2.4u, 1.2u, dish);
endchar;

beginchar(small_coproduct_sign, 8u#+2appr#, 0.8asc_height#, 0);
  "Small coproduct sign";
  pickup crisp.nib;
  tmp_program(down, -0.875u, stem, hair, u, u, 0.5u, dish);
endchar;

beginchar(coproduct_sign, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle coproduct sign";
  pickup crisp.nib;
  tmp_program(down, 0, cap_stem, cap_hair, 1.8u, 1.8u, 0.9u, dish);
endchar;

beginchar(Coproduct_sign, 21u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle coproduct sign";
  pickup crisp.nib;
  tmp_program(down, 0, disp_stem, disp_hair, 2.4u, 2.4u, 1.2u, dish);
endchar;

% BIG PLUS, BIG TIMES

beginchar(bplus_sign, 10/6dh#+2appr#, 0, 10/6dh#);
  "Textstyle big plus sign";
  use_rule2;
  pickup rule.nib; y3 = y4 = good.y 0.5[-d, h];
  pickup tiny.nib;
  pos1(rth, 0); pos2(rth, 0); pos3(rth, 90); pos4(rth, 90);
  lft x1l = hround 0.5(w-rth); x2 = x1;
  lft x3 = Appr; x1-x3 = x4-x1 = y1-y3 = y3-y2;
  filldraw stroke z1e..z2e; filldraw stroke z3e..z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Bplus_sign, 14/6dh#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle big plus sign";
  use_rule3;
  pickup rule.nib; y3 = y4 = good.y 0.5[-d, h];
  pickup tiny.nib;
  pos1(rth, 0); pos2(rth, 0); pos3(rth, 90); pos4(rth, 90);
  lft x1l = hround 0.5(w-rth); x2 = x1;
  lft x3 = Appr; x1-x3 = x4-x1 = y1-y3 = y3-y2;
  filldraw stroke z1e..z2e; filldraw stroke z3e..z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(btimes_sign, 10/6dh#+2appr#, 0, 10/6dh#);
  "Textstyle big times sign";
  use_rule2;
  pickup rule.nib; x0 = good.x 0.5w;
  y0 = y0' = good.y 0.5[-d, h];
  pickup tiny.nib; rt x0' = w-Appr;
  z1-z0 = z0-z2 = (z0'-z0) rotated 45; z3-z0 = z0-z4 = (z0'-z0) rotated -45;
  pos1(rth+2eps, -45); pos2(rth+2eps, -45);
  pos3(rth+2eps, 45); pos4(rth+2eps, 45);
  filldraw stroke z1e..z2e; filldraw stroke z4e..z3e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Btimes_sign, 14/6dh#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle big times sign";
  use_rule3;
  pickup rule.nib; x0 = good.x 0.5w;
  y0 = y0' = good.y 0.5[-d, h];
  pickup tiny.nib; rt x0' = w-Appr;
  z1-z0 = z0-z2 = (z0'-z0) rotated 45; z3-z0 = z0-z4 = (z0'-z0) rotated -45;
  pos1(rth+2eps, -45); pos2(rth+2eps, -45);
  pos3(rth+2eps, 45); pos4(rth+2eps, 45);
  filldraw stroke z1e..z2e; filldraw stroke z4e..z3e;
  penlabels(1, 2, 3, 4);
endchar;

% COMPLEMENTS

beginchar(bcomplement, 7.5u#+2appr#, 0, 10/6dh#);
  "Textstyle complement";
  autorounded; pickup tiny.nib;
  pos1(text_rth, 0); pos2(text_rth, 0);
  pos7(text_rth, 0); pos8(text_rth, 0);
  h-bot y1 = top y8+d = vround 0.25(h+d);
  y3+0.5text_rth = h+vround(o*((h+d)/cap_height))+eps;
  y6-0.5text_rth = -d-vround(o*((h+d)/cap_height))-eps;
  rt x1r = w-appr; x1 = x2 = x7 = x8;
  x4 = x5 = appr+0.5text_rth; x3 = x6 = 0.5[x1, x4];
  y2 = y4 = max(y3-x1+x3, 1/6[y1, y3]);
  y5 = y7 = min(y6+x1-x3, 1/6[y8, y6]);
  filldraw stroke z1e..z2e; filldraw stroke z7e..z8e;
  pickup pencircle scaled text_rth;
  draw flatcup(z2, z3, z4)..flatcup(z5, z6, z7);
% z4..z5 down_to_right z6 right_to_up z7;
  penlabels(1, 2, 7, 8); labels(3, 4, 5, 6);
endchar;

beginchar(Bcomplement, 10u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "displaystyle complement";
  autorounded; pickup tiny.nib;
  pos1(disp_rth, 0); pos2(disp_rth, 0);
  pos7(disp_rth, 0); pos8(disp_rth, 0);
  h-bot y1 = top y8+d = vround 0.25(h+d);
  y3+0.5disp_rth = h+vround(o*((h+d)/cap_height))+eps;
  y6-0.5disp_rth = -d-vround(o*((h+d)/cap_height))-eps;
  rt x1r = w-appr; x1 = x2 = x7 = x8;
  x4 = x5 = appr+0.5disp_rth; x3 = x6 = 0.5[x1, x4];
  y2 = y4 = max(y3-x1+x3, 1/6[y1, y3]);
  y5 = y7 = min(y6+x1-x3, 1/6[y8, y6]);
  filldraw stroke z1e..z2e; filldraw stroke z7e..z8e;
  pickup pencircle scaled disp_rth;
  draw flatcup(z2, z3, z4)..flatcup(z5, z6, z7);
% z2 up_to_left z3 left_to_down
% z4..z5 down_to_right z6 right_to_up z7;
  penlabels(1, 2, 7, 8); labels(3, 4, 5, 6);
endchar;

%
% TRUCS
%

beginchar(btruc_sign, 10/6dh#+2appr#, 0, 10/6dh#);
  "Textstyle truc sign";
  pickup tiny.nib;
  pos1(rth2, 0); pos2(rth2, 0); pos3(rth2, 90); pos4(rth2, 90);
  top y1 = top y3r = top y4r = h; bot y2 = -d;
  lft x1l = hround 0.5(w-rth2); x2 = x1;
  lft x3 = Appr; x1-x3 = x4-x1; filldraw stroke z1e..z2e;
  filldraw stroke z3e..z4e; penlabels(1, 2, 3, 4);
endchar;

beginchar(Btruc_sign, 14/6dh#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle truc sign";
  pickup tiny.nib;
  pos1(rth3, 0); pos2(rth3, 0); pos3(rth3, 90); pos4(rth3, 90);
  top y1 = top y3r = top y4r = h; bot y2 = -d;
  lft x1l = hround 0.5(w-rth2); x2 = x1;
  lft x3 = Appr; x1-x3 = x4-x1; filldraw stroke z1e..z2e;
  filldraw stroke z3e..z4e; penlabels(1, 2, 3, 4);
endchar;

beginchar(bcurt_sign, 10/6dh#+2appr#, 0, 10/6dh#);
  "Textstyle curT sign";
  pickup tiny.nib;
  pos1(rth2, 0); pos2(rth2, 0); pos3(rth2, 90); pos4(rth2, 90);
  bot y1 = bot y3l = bot y4l = -d; top y2 = h;
  lft x1l = hround 0.5(w-rth); x2 = x1;
  lft x3 = appr; x1-x3 = x4-x1; filldraw stroke z2e..z1e;
  filldraw stroke z3e..z4e; penlabels(1, 2, 3, 4);
endchar;

beginchar(Bcurt_sign, 14/6dh#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle curT sign";
  pickup tiny.nib;
  pos1(rth3, 0); pos2(rth3, 0); pos3(rth3, 90); pos4(rth3, 90);
  bot y1 = bot y3l = bot y4l = -d; top y2 = h;
  lft x1l = hround 0.5(w-rth); x2 = x1;
  lft x3 = appr; x1-x3 = x4-x1; filldraw stroke z2e..z1e;
  filldraw stroke z3e..z4e; penlabels(1, 2, 3, 4);
endchar;

%
% CUPS AND CAPS : STEMS MATCH BRACKETS ONES
%

beginchar(bcap_sign, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle cap sign";
  pickup tiny.nib;
  pos1(text_rth, 0); pos2(text_rth, 0); pos4(text_rth, 0); pos5(text_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  bot y1 = bot y5 = -d; y3+0.5text_rth = h+vround(o*((h+d)/cap_height))+eps;
  y2 = y4 = max(y3-0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
  pickup pencircle scaled text_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(Bcap_sign, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle cap sign";
  pickup tiny.nib;
  pos1(disp_rth, 0); pos2(disp_rth, 0); pos4(disp_rth, 0); pos5(disp_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  bot y1 = bot y5 = -d; y3+0.5disp_rth = h+vround(o*((h+d)/cap_height))+eps;
  y2 = y4 = max(y3-0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
  pickup pencircle scaled disp_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(bcup_sign, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle cup sign";
  pickup tiny.nib;
  pos1(text_rth, 0); pos2(text_rth, 0); pos4(text_rth, 0); pos5(text_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  top y1 = top y5 = h; y3-0.5text_rth = -d-vround(o*((h+d)/cap_height))-eps;
  y2 = y4 = min(y3+0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
  pickup pencircle scaled text_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(Bcup_sign, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle cup sign";
  pickup tiny.nib;
  pos1(disp_rth, 0); pos2(disp_rth, 0); pos4(disp_rth, 0); pos5(disp_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  top y1 = top y5 = h; y3-0.5disp_rth = -d-vround(o*((h+d)/cap_height))-eps;
  y2 = y4 = min(y3+0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
  pickup pencircle scaled disp_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(bcup_plus, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle cup-plus sign";
  ensure_centering_of(rth2);
 %
  pickup tiny.nib;
  pos1(text_rth, 0); pos2(text_rth, 0); pos4(text_rth, 0); pos5(text_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  top y1 = top y5 = h; y3-0.5text_rth = -d-vround(o*((h+d)/cap_height))-eps;
  y2 = y4 = min(y3+0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
 %
  pos6(rth2, 0); pos7(rth2, 0); pos8(rth2, 90); pos9(rth2, 90);
  y8 = y9 = vround(0.5[-d, h]-0.5rth2)+0.5rth2;
  x6 = x7 = 0.5w;
  numeric a;
  a = 0.5(min(lft x5l-rt x1r-2.6u, h+d-text_rth-1.3u)-text_rth);
  y6-y8r = y8l-y7 = vround a; x6l-x8 = x9-x6r = hround a;
  filldraw stroke z6e..z7e; filldraw stroke z8e..z9e;
 %
  pickup pencircle scaled text_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5, 6, 7, 8, 9);
endchar;

beginchar(Bcup_plus, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle cup-plus sign";
  ensure_centering_of(rth3);
 %
  pickup tiny.nib;
  pos1(disp_rth, 0); pos2(disp_rth, 0); pos4(disp_rth, 0); pos5(disp_rth, 0);
  lft x1l = lft x2l = appr; rt x4r = rt x5r = w-appr; x3 = 0.5[x2, x4];
  top y1 = top y5 = h; y3-0.5disp_rth = -d-vround(o*((h+d)/cap_height))-eps;
  y2 = y4 = min(y3+0.5(x4-x2), 0.5[y3, y1]);
  filldraw stroke z2e..z1e; filldraw stroke z4e..z5e;
 %
  pos6(rth3, 0); pos7(rth3, 0); pos8(rth3, 90); pos9(rth3, 90);
  y8 = y9 = vround(0.5[-d, h]-0.5rth3)+0.5rth3;
  x6 = x7 = 0.5w;
  numeric a;
  a = 0.5(min(lft x5l-rt x1r-2.9u, h+d-disp_rth-1.45u)-disp_rth);
  y6-y8r = y8l-y7 = vround a; x6l-x8 = x9-x6r = hround a;
  filldraw stroke z6e..z7e; filldraw stroke z8e..z9e;
 %
  pickup pencircle scaled disp_rth; autorounded; draw flatcup(z2, z3, z4);
  penlabels(1, 2, 3, 4, 5, 6, 7, 8, 9);
endchar;

beginchar(bsqcap_sign, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle square cap sign";
  pickup tiny.nib;
  pos1(text_rth, 180); pos4(text_rth, 0);
  top y2r = top y3r = h; bot y1 = bot y4 = -d;
  top y2r-bot y2l = top y3r-bot y3l = text_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Bsqcap_sign, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle square cap sign";
  pickup tiny.nib;
  pos1(disp_rth, 180); pos4(disp_rth, 0);
  top y2r = top y3r = h; bot y1 = bot y4 = -d;
  top y2r-bot y2l = top y3r-bot y3l = disp_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(bsqcup_sign, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle square cup sign";
  pickup tiny.nib;
  pos1(text_rth, 180); pos4(text_rth, 0);
  bot y2r = bot y3r = -d; top y1 = top y4 = h;
  top y2l-bot y2r = top y3l-bot y3r = text_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Bsqcup_sign, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle square cup sign";
  pickup tiny.nib;
  pos1(disp_rth, 180); pos4(disp_rth, 0);
  bot y2r = bot y3r = -d; top y1 = top y4 = h;
  top y2l-bot y2r = top y3l-bot y3r = disp_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(bsqcup_plus, 14u#+2appr#, 0, 10/6dh#);
  "Textstyle square cup-plus sign";
  ensure_centering_of(rth2);
 %
  pickup tiny.nib;
  pos1(text_rth, 180); pos4(text_rth, 0);
  bot y2r = bot y3r = -d; top y1 = top y4 = h;
  top y2l-bot y2r = top y3l-bot y3r = text_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
 %
  pos6(rth2, 0); pos7(rth2, 0); pos8(rth2, 90); pos9(rth2, 90);
  y8 = y9 = vround(0.5[-d, h]-0.5rth2)+0.5rth2;
  x6 = x7 = 0.5w;
  numeric a;
  a = 0.5(min(lft x4l-rt x1l-2.6u, h+d-text_rth-1.3u)-text_rth);
  y6-y8r = y8l-y7 = vround a; x6l-x8 = x9-x6r = hround a;
  filldraw stroke z6e..z7e; filldraw stroke z8e..z9e;
  penlabels(1, 2, 3, 4, 6, 7, 8, 9);
endchar;

beginchar(Bsqcup_plus, 18u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle square cup-plus sign";
  ensure_centering_of(rth3);
 %
  pickup tiny.nib;
  pos1(disp_rth, 180); pos4(disp_rth, 0);
  bot y2r = bot y3r = -d; top y1 = top y4 = h;
  top y2l-bot y2r = top y3l-bot y3r = disp_rth;
  lft x1r = appr; rt x4r = w-appr;
  x2r = x1r; x3r = x4r; x2l = x1l; x3l = x4l;
  filldraw stroke z1e--z2e--z3e--z4e;
 %
  pos6(rth3, 0); pos7(rth3, 0); pos8(rth3, 90); pos9(rth3, 90);
  y8 = y9 = vround(0.5[-d, h]-0.5rth3)+0.5rth3;
  x6 = x7 = 0.5w;
  numeric a;
  a = 0.5(min(lft x4l-rt x1l-2.9u, h+d-disp_rth-1.45u)-disp_rth);
  y6-y8r = y8l-y7 = vround a; x6l-x8 = x9-x6r = hround a;
  filldraw stroke z6e..z7e; filldraw stroke z8e..z9e;
  penlabels(1, 2, 3, 4, 6, 7, 8, 9);
endchar;

%
% WEDGES AND VEES
%

beginchar(bwedge_sign, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle wedge sign";
  pickup tiny.nib;
  lft x1 = appr; x2 = good.x 0.5w;
  x3-x2 = x2-x1; bot y1 = -d; y1 = y3 = y4 = y6;
  top y2 = h+vround(o*((h+d)/cap_height))+eps;
  x6-x1 = diag_width(text_rth-tiny, z2-z1);
  x3-x4 = diag_width(text_rth-tiny, z2-z3);
  z5-z4 = whatever*(z2-z3); z5-z6 = whatever*(z2-z1);
  filldraw z1--z2--z3--z4--z5--z6--cycle;
  labels(1, 2, 3, 4, 5, 6);
endchar;

beginchar(Bwedge_sign, 22.4u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle wedge sign";
  pickup tiny.nib;
  lft x1 = appr; x2 = good.x 0.5w;
  x3-x2 = x2-x1; bot y1 = -d; y1 = y3 = y4 = y6;
  top y2 = h+vround(o*((h+d)/cap_height))+eps;
  x6-x1 = diag_width(disp_rth-tiny, z2-z1);
  x3-x4 = diag_width(disp_rth-tiny, z2-z3);
  z5-z4 = whatever*(z2-z3); z5-z6 = whatever*(z2-z1);
  filldraw z1--z2--z3--z4--z5--z6--cycle;
  labels(1, 2, 3, 4, 5, 6);
endchar;

beginchar(bvee_sign, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle vee sign";
  pickup tiny.nib;
  lft x1 = appr; x2 = good.x 0.5w;
  x3-x2 = x2-x1; top y1 = h; y1 = y3 = y4 = y6;
  bot y2 = -d-vround(o*((h+d)/cap_height))-eps;
  x6-x1 = diag_width(text_rth-tiny, z2-z1);
  x3-x4 = diag_width(text_rth-tiny, z2-z3);
  z5-z4 = whatever*(z2-z3); z5-z6 = whatever*(z2-z1);
  filldraw z1--z2--z3--z4--z5--z6--cycle;
  labels(1, 2, 3, 4, 5, 6);
endchar;

beginchar(Bvee_sign, 22.4u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle vee sign";
  pickup tiny.nib;
  lft x1 = appr; x2 = good.x 0.5w;
  x3-x2 = x2-x1; top y1 = h; y1 = y3 = y4 = y6;
  bot y2 = -d-vround(o*((h+d)/cap_height))-eps;
  x6-x1 = diag_width(disp_rth-tiny, z2-z1);
  x3-x4 = diag_width(disp_rth-tiny, z2-z3);
  z5-z4 = whatever*(z2-z3); z5-z6 = whatever*(z2-z1);
  filldraw z1--z2--z3--z4--z5--z6--cycle;
  labels(1, 2, 3, 4, 5, 6);
endchar;

beginchar(bwedge_curly, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle curly wedge sign";
  pickup tiny.nib;
  x2 = hround 0.5(w-text_rth)+0.5text_rth;
  top y2 = h+vround(o*((h+d)/cap_height))+eps;
  pos2(text_rth, 0); bot y1r = bot y3l = -d;
  lft x1r = appr;
  x3l-x2r = x2l-x1r; x1l = x1r; x3l = x3r;
  x4 = x2; pos4(text_rth, 0); y4 = 0.625[y2, y1r];
  y1l-y1r = y3r-y3l = (text_rth-tiny)/cosd angle(z4r-z1r);
  filldraw stroke z2e{down}...z1e{z1r-z4r};
  filldraw stroke z2e{down}...z3e{z3l-z4l};
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Bwedge_curly, 22.4u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle curly wedge sign";
  pickup tiny.nib;
  x2 = hround 0.5(w-disp_rth)+0.5disp_rth;
  top y2 = h+vround(o*((h+d)/cap_height))+eps;
  pos2(disp_rth, 0); bot y1r = bot y3l = -d;
  lft x1r = appr;
  x3l-x2r = x2l-x1r; x1l = x1r; x3l = x3r;
  x4 = x2; pos4(disp_rth, 0); y4 = 0.625[y2, y1r];
  y1l-y1r = y3r-y3l = (disp_rth-tiny)/cosd angle(z4r-z1r);
  filldraw stroke z2e{down}...z1e{z1r-z4r};
  filldraw stroke z2e{down}...z3e{z3l-z4l};
  penlabels(1, 2, 3, 4);
endchar;

beginchar(bvee_curly, 16u#+2appr#, 0, 10/6dh#);
  "Textstyle curly vee sign";
  pickup tiny.nib;
  x2 = hround 0.5(w-text_rth)+0.5text_rth;
  bot y2 = -d-vround(o*((h+d)/cap_height))-eps;
  pos2(text_rth, 0); top y1r = top y3l = h;
  lft x1r = appr;
  x1l = x1r; x3l = x3r; x3l-x2r = x2l-x1r;
  x4 = x2; pos4(text_rth, 0); y4 = 0.625[y2, y1r];
  y1r-y1l = y3l-y3r = (text_rth-tiny)/cosd angle(z4r-z1r);
  filldraw stroke z2e{up}...z1e{z1r-z4r};
  filldraw stroke z2e{up}...z3e{z3l-z4l};
  penlabels(1, 2, 3, 4);
endchar;

beginchar(Bvee_curly, 22.4u#+2appr#, 0, 14/6dh#);
  padded bigop_padding#;
  "Displaystyle curly vee sign";
  pickup tiny.nib;
  x2 = hround 0.5(w-disp_rth)+0.5disp_rth;
  bot y2 = -d-vround(o*((h+d)/cap_height))-eps;
  pos2(disp_rth, 0); top y1r = top y3l = h;
  lft x1r = appr;
  x1l = x1r; x3l = x3r; x3l-x2r = x2l-x1r;
  x4 = x2; pos4(disp_rth, 0); y4 = 0.625[y2, y1r];
  y1r-y1l = y3l-y3r = (disp_rth-tiny)/cosd angle(z4r-z1r);
  filldraw stroke z2e{up}...z1e{z1r-z4r};
  filldraw stroke z2e{up}...z3e{z3l-z4l};
  penlabels(1, 2, 3, 4);
endchar;

% UGLY

beginchar(btriangle_up, 16u#+2appr#, 0, 10/6dh#);
  "Big triangle up";
  pickup tiny.nib; lft x1r = appr;
  x2r = good.x 0.5w; x3r-x2r = x2r-x1r;
  bot y1r = -d; y1r = y3r = y1 = y3; top y2r = h+o;
  top y1l-bot y1r = top y3l-bot y3r = rth;
  x1-x1r = diag_width(rth-tiny, z2r-z1r);
  x3r-x3 = diag_width(rth-tiny, z2r-z3r);
  z2l-z1 = whatever*(z2r-z1r); z2l-z3 = whatever*(z2r-z3r);
  z1l = whatever[z1, z2l]; z3l = whatever[z3, z2l];
  filldraw stroke z1e--z2e--z3e--z1e; penlabels(1, 2, 3);
endchar;

beginchar(btriangle_down, 16u#+2appr#, 0, 10/6dh#);
  "Big triangle down";
  pickup tiny.nib; lft x1r = appr;
  x2r = good.x 0.5w; x3r-x2r = x2r-x1r;
  top y1r = h; y1r = y3r = y1 = y3; bot y2r = -d-o;
  top y1r-bot y1l = top y3r-bot y3l = rth;
  x1-x1r = diag_width(rth-tiny, z2r-z1r);
  x3r-x3 = diag_width(rth-tiny, z2r-z3r);
  z2l-z1 = whatever*(z2r-z1r); z2l-z3 = whatever*(z2r-z3r);
  z1l = whatever[z1, z2l]; z3l = whatever[z3, z2l];
  filldraw stroke z1e--z2e--z3e--z1e; penlabels(1, 2, 3);
endchar;

% INTEGRALS

beginchar(bintegral_sign,6u#+2appr#,0,100/54dh#);
  "Textstyle integral sign";
  z.c=(0.5w,0.5[-d,h]);
  y.t=y.tl=y.tr=h; y.b=y.bl=y.br=-d;
  x.c-x.t=x.b-x.c=2.3u;% slope
  x.tr-x.t=x.t-x.tl=x.br-x.b=x.b-x.bl=.5cap_stem/sind(angle(z.t-z.c));
  z1 = 0.52[z.bl,z.tl];
  z2 = (hround(appr+u), 0.82[-d, h]);
  z3 = (w-appr-2.3u, 1[-d, h]);
  z4 = (w-appr, 0.63[y3, y5]);
  z5 = (w-appr-0.7u, vround(h-0.2dh));
  z6 = (w-appr-2.5u, 1[-d, h]-cap_hair);
  z7 = 0.75[z.br,z.tr];
  x1.2=x2; z1.2-z1=whatever*(z.t-z.c);
  y6.7=y6; z6.7-z7=whatever*(z.t-z.c);
  path lastpath;
  lastpath := 
  z1..controls 0.6[z1,z1.2] and 0.5[z2,z1.2]..
  z2..controls(x2, 0.55[y2, y3]) and (0.65[x3, x2], y3)..
  z3..controls(0.79[x3, x4], y3) and (x4, 0.44[y4, y3])..
  z4..controls(x4, 0.6[y4, y5]) and (0.6[x5, x4], y5)..
  z5..controls(0.65[x5, x6], y5) and (0.6[x6, x5], y6)..
  z6..controls 0.6[z6, z6.7] and 0.65[z7, z6.7]..
  z7;
  lastpath := lastpath--lastpath rotated 180 shifted (w, -d)--cycle;
  fill lastpath;
  labels(1,2,3,4,5,6,7,1.2,6.7);
  charwd:=charwd-u#; italcorr 0.5u#; w:= round(charwd*hppp);
  tmp_picture := currentpicture;  
endchar;

beginchar(bintegral_double, 11.5u#+2appr#, 0, 100/54dh#);
  "Textstyle double integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 6.5u, 0));
endchar;

beginchar(bintegral_triple, 
    18u#+2appr#, 0, 100/54dh#);
  "Textstyle triple integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 6.5u, 0))
  +(tmp_picture shifted (2hround 6.5u, 0));
endchar;

beginchar(bintegral_contour, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle contour integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup rule.nib0;
  rt x1 = w-appr+hround 1.5u+eps;
  lft x3 = appr-hround 0.5u-eps; x2=x4=0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+3.5u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  labels(1,2,3,4);
endchar;

arrow_head_fitting:= true;
arrow_width  := 2ceiling 0.70spread1+rth;
arrow_height# := 4u#;
arrow_height := round 4u;
arrow_breadth := rth;
arrow_stress := 0.65;
arrow_tense1 := 0.75;
arrow_tense2 := 0.875;

beginchar(bintegral_contour_pos, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle positive contour integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup rule.nib0;
  rt x1 = w-appr+hround 1.5u+eps;
  lft x3 = appr-hround 0.5u-eps; x2=x4=0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+3.5u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  pickup tiny.nib;
  arrow_head5(subpath (0,3) of (z4 right_to_up z1 up_to_left z2), both);
  labels(1, 2, 3, 4, 5, 5l, 5r);
endchar;

beginchar(bintegral_contour_neg, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle negative contour integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup rule.nib0;
  rt x1 = w-appr+hround 1.5u+eps;
  lft x3 = appr-hround 0.5u-eps; x2=x4=0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+3.5u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  pickup tiny.nib;
  arrow_head5(subpath (0,3) of (z2 right_to_down z1 down_to_left z4), both);
  labels(1, 2, 3, 4, 5, 5l, 5r);
endchar;

beginchar(bintegral_square, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle square integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup tiny.nib;
  top y1r = top y2r = vround(0.5[-d, h]+3.5u);
  rt x2r = rt x3r = w-appr+hround 1.5u;
  0.5[y1r, y3r] = 0.5[y2r, y4r] = 0.5[-d, h];
  lft x1r=lft x4r=appr-hround 0.5u; 
  rt x1l-lft x1r = rt x2r-lft x2l
  = rt x3r-lft x3l = rt x4l-lft x4r = rth0;
  top y1r-bot y1l = top y2r-bot y2l
  = top y3l-bot y3r = top y4l-bot y4r = rth0;
  filldraw stroke z1e--z2e--z3e--z4e--z1e;
  penlabels(1, 2, 3, 4);
endchar;

beginchar(bintegral_square_pos, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle positive square integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup tiny.nib;
  top y1r = top y2r = vround(0.5[-d, h]+3.5u);
  rt x2r = rt x3r = w-appr+hround 1.5u;
  0.5[y1r, y3r] = 0.5[y2r, y4r] = 0.5[-d, h];
  lft x1r=lft x4r=appr-hround 0.5u; 
  rt x1l-lft x1r = rt x2r-lft x2l
  = rt x3r-lft x3l = rt x4l-lft x4r = rth0;
  top y1r-bot y1l = top y2r-bot y2l
  = top y3l-bot y3r = top y4l-bot y4r = rth0;
  filldraw stroke z1e--z2e--z3e--z4e--z1e;
  pickup tiny.nib; z2=0.5[z2l,z2r]; z3=0.5[z3l,z3r];
  arrow_head5(z3..0.75[z3,z2], both);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(bintegral_square_neg, 5u#+2appr#, 0, 100/54dh#);
  "Textstyle negative square integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture;
  pickup tiny.nib;
  top y1r = top y2r = vround(0.5[-d, h]+3.5u);
  rt x2r = rt x3r = w-appr+hround 1.5u;
  0.5[y1r, y3r] = 0.5[y2r, y4r] = 0.5[-d, h];
  lft x1r=lft x4r=appr-hround 0.5u; 
  rt x1l-lft x1r = rt x2r-lft x2l
  = rt x3r-lft x3l = rt x4l-lft x4r = rth0;
  top y1r-bot y1l = top y2r-bot y2l
  = top y3l-bot y3r = top y4l-bot y4r = rth0;
  filldraw stroke z1e--z2e--z3e--z4e--z1e;
  pickup tiny.nib; z2=0.5[z2l,z2r]; z3=0.5[z3l,z3r];
  arrow_head5(z2..0.75[z2,z3], both);
  penlabels(1, 2, 3, 4, 5);
endchar;

beginchar(bintegral_dblcont, 11u#+2appr#, 0, 100/54dh#);
  "Textstyle double contour integral sign";
  italcorr 0.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 6u, 0));
  pickup rule.nib0;
  rt x1 = w-appr+hround 1.5u+eps; lft x3 = appr-hround 0.5u-eps;
  x2 = x4 = 0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+3.5u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  labels(1, 2, 3, 4);
endchar;

beginchar(Bintegral_sign, 12u#+2appr#,0,200/54dh#);
%  save disp_stem; disp_stem=hround 2.2u;%46/36pt;
  z1 = (hround(0.5w-0.5disp_stem), 0.52[-d, h]);
  z2 = (w-appr-2.6u, 1[-d, h]);
  z3 = (w-appr, 0.63[y2, y4]);
  z4 = (w-appr-0.9u, vround(h-0.24dh));
  z5 = (w-appr-2.8u, 1[-d, h]-disp_hair);
  z6 = (x1+disp_stem, 0.75[-d, h]);
  path lastpath;
  lastpath :=
  z1..controls(x1, 0.6[y1, y2]) and (0.85[x2, x1], y2)..
  z2..controls(0.79[x2, x3], y2) and (x3, 0.44[y3, y2])..
  z3..controls(x3, 0.6[y3, y4]) and (0.6[x4, x3], y4)..
  z4..controls(0.65[x4, x5], y4) and (0.6[x5, x4], y5)..
  z5..controls(0.55[x5, x6], y5) and (x6, 0.8[y6, y5])..
  z6;
  lastpath := lastpath--lastpath shifted (-x1,0)
  rotated 180 shifted (x6, -d)--cycle;
  fill lastpath;
  labels(1,2,3,4,5,6);
  charwd:=charwd-5u#; italcorr 4.5u#; w:= round(charwd*hppp);
  tmp_picture := currentpicture;
  integral_x:=x1;
endchar;

beginchar(Bintegral_double, 16.5u#+2appr#, 0,200/54dh#);
  "Displaystyle double integral sign";
  italcorr 4.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 9.5u, 0));
endchar;

beginchar(Bintegral_triple, 26u#+2appr#, 0,200/54dh#);
  "Displaystyle triple integral sign";
  italcorr 4.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 9.5u, 0))
  +(tmp_picture shifted (2hround 9.5u, 0));
endchar;

beginchar(Bintegral_contour, 7u#+2appr#, 0,200/54dh#);
  "Displaystyle contour integral sign";
  italcorr 4.5u#;
  currentpicture := tmp_picture;
  pickup rule.nib0;
  lft x3 = appr+hround 0.75u-eps;
  x1 = 2integral_x-x3+disp_stem;
  x2=x4=0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+5.25u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  labels(1,2,3,4);
endchar;

beginchar(Bintegral_dblcont, 16u#+2appr#, 0,200/54dh#);
  "Displaystyle double contour integral sign";
  italcorr 4.5u#;
  currentpicture := tmp_picture+(tmp_picture shifted (hround 9u, 0));
  pickup rule.nib0;
  lft x3 = appr-eps;
  x1 = 2integral_x-x3+disp_stem+hround 9u;
  x2=x4=0.5[x1,x3];
  top y2 = vround(0.5[-d, h]+6u)+eps;
  0.5[y2, y4] = 0.5[-d, h] = y1 = y3;
  draw z1 up_to_left z2 left_to_down z3
  down_to_right z4 right_to_up z1;
  labels(1,2,3,4);
endchar;