summaryrefslogtreecommitdiff
path: root/fonts/mnsymbol/source/Sym-Operators.mf
blob: bb93d8291de03b9bd2e74aad87dd2fcb7fd6e37a (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
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

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big plus";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    draw (centre + op_height/2 * dir  0) -- (centre + op_height/2 * dir 180);
    draw (centre + op_height/2 * dir 90) -- (centre + op_height/2 * dir 270);
  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginbigop(scale, scale); "big times";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    z1 - z0 = z3 - z2 = op_width * dir 0;
    z2 - z0 = op_width * dir 90;

    1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

    draw z0 -- z3;
    draw z1 -- z2;
  endchar;
endfor;
charlist current_char - 1: current_char;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big wedge";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      draw z0 -- 1/2[z1, z2] -- z3;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big wedge dot";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      draw z0 -- 1/2[z1, z2] -- z3;
      fill circle(centre - sign * 1/4op_height * dir 90, 4/3dot_size * sqrt scale);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(6/5scale, scale); "double big wedge";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = 5/6op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      1/2[z0a,z0b] = z0;
      1/2[z1a,z1b] = 1/2[z1, z2];
      1/2[z2a,z2b] = z3;
      z0b - z0a = z1b - z1a = z2b - z2a = 1/3(plus_size + 11/5rule_thickness) * dir 0;

      draw z0a -- z1a -- z2a;
      draw z0b -- z1b -- z2b;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big curly wedge";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      draw prec(centre + sign * op_height/2 * dir 90,
                centre - sign * op_height/2 * dir 90,
                op_width);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big curly wedge dot";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      draw prec(centre + sign * op_height/2 * dir 90,
                centre - sign * op_height/2 * dir 90,
                op_width);
      fill circle(centre - sign * 3/8op_height * dir 90, 4/3dot_size * sqrt scale);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(6/5scale, scale); "double big curly wedge";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      1/2[z0,z1] = centre;
      z1 - z0 = 1/3(plus_size + 11/5rule_thickness) * dir 0;

      draw prec(z0 + sign * op_height/2 * dir 90,
                z0 - sign * op_height/2 * dir 90,
                5/6op_width);
      draw prec(z1 + sign * op_height/2 * dir 90,
                z1 - sign * op_height/2 * dir 90,
                5/6op_width);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big union";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      draw subset(centre + sign * op_height/2 * dir 90,
                  centre - sign * op_height/2 * dir 90,
                  op_width);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big union dot";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      draw subset(centre + sign * op_height/2 * dir 90,
                  centre - sign * op_height/2 * dir 90,
                  op_width);
      fill circle(centre - sign * 1/8op_height * dir 90, 4/3dot_size * sqrt scale);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big union plus";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      draw subset(centre + sign * op_height/2 * dir 90,
                  centre - sign * op_height/2 * dir 90,
                  op_width);

      t := 2rule_thickness;
      r := 3/8op_width - t;

      draw (centre - sign * 1/8op_width * dir 90 + r * dir  0)
        -- (centre - sign * 1/8op_width * dir 90 + r * dir 180);
      draw (centre + (r - sign * 1/8op_width) * dir 90)
        -- (centre + (r + sign * 1/8op_width) * dir 270);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big square union";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      draw z0 -- z1 -- z2 -- z3;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big square union dot";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      draw z0 -- z1 -- z2 -- z3;
      fill circle(centre - sign * 1/8op_height * dir 90, 4/3dot_size * sqrt scale);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for sign = 1, -1:
  for scale = 1, 1.4:
    beginbigop(scale, scale); "big square union plus";

      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      z3 - z0 = z2 - z1 = op_width * dir 0;
      z1 - z0 = sign * op_height * dir 90;

      1/2[1/2[z0,z1], 1/2[z2,z3]] = centre;

      draw z0 -- z1 -- z2 -- z3;

      t := 2rule_thickness;
      r := 3/8op_width - t;

      draw (centre - sign * 1/8op_width * dir 90 + r * dir  0)
        -- (centre - sign * 1/8op_width * dir 90 + r * dir 180);
      draw (centre + (r - sign * 1/8op_width) * dir 90)
        -- (centre + (r + sign * 1/8op_width) * dir 270);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    draw circle(centre, op_height/2);
  endchar;
endfor;
charlist current_char - 1: current_char;

for alpha = 0, 90, 45, 135:
  for scale = 1, 1.4:
    beginsquarebigop(scale, scale); "big circle minus";
      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      r := op_height/2 - 11/10 * (4/3rule_thickness * sqrt scale);

      draw circle(centre, op_height/2);
      draw (centre - r * dir alpha) -- (centre + r * dir alpha);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for alpha = 0, 45:
  for scale = 1, 1.4:
    beginsquarebigop(scale, scale); "big circle plus";
      pickup pencircle scaled (4/3rule_thickness * sqrt scale);

      r := op_height/2 - 11/10 * (4/3rule_thickness * sqrt scale);

      draw circle(centre, op_height/2);
      draw (centre - r * dir alpha)          -- (centre + r * dir alpha);
      draw (centre - r * dir (alpha + 90))   -- (centre + r * dir (alpha + 90));
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle dot";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    draw circle(centre, op_height/2);
    fill circle(centre, scale * 1.3dot_size);
  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle circle";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    draw circle(centre, op_height/2);
    draw circle(centre, op_height/5);
  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle triangle";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    draw circle(centre, op_height/2);

    pickup rule_pen;

    draw triangle(centre, op_height/5, 90);
  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle asterisk";
    thick := 4/3rule_thickness * sqrt scale;

    pickup pencircle scaled thick;

    r := op_height/2 - 11/10rule_thickness * (4/3 * sqrt scale);

    draw circle(centre, op_height/2);

    penpos a0(4/3thick,   0 - 7);
    penpos a1(4/3thick,  72 - 7);
    penpos a2(4/3thick, 144 - 7);
    penpos a3(4/3thick, 216 - 7);
    penpos a4(4/3thick, 288 - 7);

    penpos b0(2/3thick,   0 - 7);
    penpos b1(2/3thick,  72 - 7);
    penpos b2(2/3thick, 144 - 7);
    penpos b3(2/3thick, 216 - 7);
    penpos b4(2/3thick, 288 - 7);

    reg_poly_points(a)(5, centre, r, 77);

    z.b0 = z.b1 = z.b2 = z.b3 = z.b4 = centre;

    fill stroke z.a0e -- z.b0e;
    fill stroke z.a1e -- z.b1e;
    fill stroke z.a2e -- z.b2e;
    fill stroke z.a3e -- z.b3e;
    fill stroke z.a4e -- z.b4e;
  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginsquarebigop(scale, scale); "big circle star";
    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    r := op_height/2 - 11/10rule_thickness * (4/3 * sqrt scale);

    draw circle(centre, op_height/2);

    pickup rule_pen;

    reg_poly_points(a)(5, centre, r, 90);
    reg_poly_points(b)(5, centre, r/10, 126);

    draw z.a0 -- z.b0 -- z.a1 -- z.b1 -- z.a2 -- z.b2 -- z.a3 -- z.b3 -- z.a4 -- z.b4 -- cycle;
    fill z.a0 -- z.b0 -- z.a1 -- z.b1 -- z.a2 -- z.b2 -- z.a3 -- z.b3 -- z.a4 -- z.b4 -- cycle;
  endchar;
endfor;
charlist current_char - 1: current_char;

for sign = 1, -1:
  for scale = 1.1, 1.54:
    beginbigop(1.1scale, scale); "product";
      draw_product(centre, op_width, op_height, sign, 5/3rule_thickness * sqrt scale);
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

def draw_sum(suffix $)(expr centre, width, height, thick) =
  thin := 2/3thick;

  z1$ - z0$ = z3$ - z2$ = width * dir 0;
  z2$ - z0$ = height * dir 90;

  1/2[1/2[z0$,z1$], 1/2[z2$,z3$]] = centre;

  z4$ - z1$ = z3$ - z5$ = 1/5height * dir 90;

  z6$ = whatever[z0$,z1$] = z4$ - whatever * dir 77;
  z7$ = whatever[z2$,z3$] = z5$ + whatever * dir -77;

  penpos 0$(thick,  90);
  penpos 6$(thick,  90);
  penpos 4$(thin,  167);
  penpos 2$(thin,  -90);
  penpos 7$(thin,  -90);
  penpos 5$(thin,  203);

  z8$ = centre;
  penpos 8$(2thin, 20);

  z9$ = z8$r + whatever * (z2$r - z8$l) = whatever[z2$r,z7$r];

  z10$ = z0$l + thin * dir 90;
  z11$ = z8$r + whatever * (z10$ - z8$l);
  y11$ = y10$;

  z12$ = whatever[z10$,z8$l];
  y12$ = y0$r;

  fill z0$l -- z6$l -- z4$l -- z4$r{-dir 77} .. {dir 180}1/4[z6$r,z0$r] -- z12$ -- z10$ -- cycle;
  fill z2$l -- z7$l -- z5$l -- z5$r{dir 113} .. {dir 180}1/4[z7$r,z2$r] -- z2$r -- cycle;
  fill z2$r -- z8$l -- z8$r -- z9$ -- cycle;
  fill z10$ -- z8$l -- z8$r -- z11$ -- cycle;
enddef;

for scale = 1.1, 1.54:
  beginbigop(scale, scale); "sum";
    draw_sum(a)(centre, op_width, op_height, 4/3rule_thickness * sqrt scale);
  endchar;
endfor;
charlist current_char - 1: current_char;

for number = 0, 1, 2, 3:
  for scale = 1, 1.8:

    display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
    text_shift#    := (scale-1) * 1/2order_width#;
    define_whole_pixels(display_shift, text_shift);

    beginsymbol(scale * (1/2 + 2/3number) * order_width# + 2side_bearing# + display_shift# - text_shift#,
                ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
      "integral";

      italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

      pair centre;

      for i = 0 upto number:
        centre := ((w - scale * (number - 2*i) * 2/3order_width + display_shift + text_shift)/2,
                   (h - d)/2);

        draw_integral([i])(scale, centre);
      endfor;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for scale = 1, 1.8:

  display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := (scale-1) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift);

  beginsymbol(scale * (1/2 + 1) * order_width# + 2side_bearing# + display_shift# - text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "integral dots";

    italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

    pair centre;

    centre := ((w - 2scale * order_width + display_shift + text_shift)/2,
               (h - d)/2);

    draw_integral([0])(scale, centre);

    centre := ((w + 2scale * order_width + display_shift + text_shift)/2,
               (h - d)/2);

    draw_integral([2])(scale, centre);

    z0 = 1/4[z0[0],z0[2]];
    z1 = 2/4[z0[0],z0[2]];
    z2 = 3/4[z0[0],z0[2]];

    fill circle(z0, dot_size);
    fill circle(z1, dot_size);
    fill circle(z2, dot_size);
  endchar;
endfor;
charlist current_char - 1: current_char;

for sign = 1, -1:
  for scale = 1, 1.8:

    display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
    text_shift#    := (scale-1) * 1/2order_width#;
    define_whole_pixels(display_shift, text_shift);

    beginsymbol(scale * 1/2order_width# + 2side_bearing# + display_shift# - text_shift#,
                ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
      "landup/down integral";

      italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

      pair centre;

      centre := ((w + display_shift + text_shift)/2, (h - d)/2);

      draw_integral(a)(scale, centre);

      pickup pencircle scaled 1/2thick;

      z0 = z0a + sign * sqrt scale * (-2thick, -2/3thick);
      z1 = z0a + sign * sqrt scale * ( 0,       2/3thick);
      z2 = z0a + sign * sqrt scale * ( 2thick, -2/3thick);

      draw z0 .. z1 .. z2;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for scale = 1, 1.8:

  display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := (scale-1) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift);

  beginsymbol(scale * 1/2order_width# + 2side_bearing# + display_shift# - text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "stroked integral";

    italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

    pair centre;

    centre := ((w + display_shift + text_shift)/2, (h - d)/2);

    draw_integral(a)(scale, centre);

    alpha := angle (z1a - z3a) - 70;

    pickup pencircle scaled 1/2thick;

    draw (z0a - sqrt scale * 2thick * dir alpha) -- (z0a + sqrt scale * 2thick * dir alpha);
  endchar;
endfor;
charlist current_char - 1: current_char;

for number = 0, 1:
  for scale = 1, 1.8:

    display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
    text_shift#    := (scale-1.3) * 4/5order_width#;
    define_whole_pixels(display_shift, text_shift);

    beginsymbol(scale * (1/2 + 2/3number) * order_width# + 2side_bearing# + display_shift# - text_shift#,
                ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
      "contour integral";

      italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

      pair centre;

      for i = 0 upto number:
        centre := ((w - scale * (number - 2*i) * 2/3order_width + display_shift + text_shift)/2,
                   (h - d)/2);

        draw_integral([i])(scale, centre);
      endfor;

      centre := 1/2[z0[0], z0[number]];

      pickup pencircle scaled 5/12thick;

      if number = 0:
        draw circle(centre, 2thick * sqrt scale);
      else:
        draw super_ellipse(centre,
                           (2thick + number * 5/5thick) * sqrt scale,
                           (2thick + number * 1/5thick) * sqrt scale,
                           7/8, 0);
      fi;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for alpha = -90, 90:
  for sign = 1, -1:
    for scale = 1, 1.8:

      display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
      text_shift#    := (scale-1.3) * 4/5order_width#;
      define_whole_pixels(display_shift, text_shift);

      beginsymbol(scale * 1/2order_width# + 2side_bearing# + display_shift# - text_shift#,
                  ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                  (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
        "oriented contour integral";

        italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

        pair centre;
        centre := ((w+display_shift+text_shift)/2, (h-d)/2);

        draw_integral(a)(scale, centre);

        pickup pencircle scaled 5/12thick;

        r := 2thick * sqrt scale;

        beta := alpha + angle (z1a - z3a) + 25sign;

        reg_poly_points(a)(8, z0a, r, beta);

        z0 = z0a + r * dir (beta + 10);
        z1 = z0a + r * dir (beta - 10);

        draw z0{dir (beta + 100)} .. z.a1 .. z.a2 .. z.a3 .. z.a4 .. z.a5 .. z.a6 .. z.a7 ..
            {dir (beta + 80)}z1;

        if sign > 0:
          draw arrowhead(z1, (beta + 65), 1/2scale * arrow_spread);
        else:
          draw arrowhead(z0, (beta - 65), 1/2scale * arrow_spread);
        fi;
      endchar;
    endfor;
    charlist current_char - 1: current_char;
  endfor;
endfor;

for scale = 1, 1.8:

  display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := (scale-1) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift);

  beginsymbol(scale * 1/2order_width# + 2side_bearing# + display_shift# - text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "sum integral";

    italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

    pair centre;

    centre := ((w + display_shift + text_shift)/2, (h - d)/2);

    draw_integral(a)(scale, centre);
    draw_sum(b, 1/3[z0a.l,z0a.r], scale * order_width, 3/4scale * asc_height, 1/2thick);

  endchar;
endfor;
charlist current_char - 1: current_char;

%for scale = 1, 1.8:
%
%  display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
%  text_shift#    := -2/8order_width#;
%  script_delta#  := (1 + 3/2(scale-1)) * 1/2order_width#;
%  define_whole_pixels(display_shift, text_shift, script_delta);
%
%  beginsymbol(scale * 1/2 * order_width# + 2side_bearing# - display_shift# - 2text_shift#,
%              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
%              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
%    "partial integral";
%
%    italcorr script_delta#; % kerning between upper limit and lower limit
%  endchar;
%endfor;
%charlist current_char - 1: current_char;

for scale = 1, 1.8:

  display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := -2/8order_width#;
  script_delta#  := (1 + 3/2(scale-1)) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift, script_delta);

  beginsymbol(scale * (1/2 + 1) * order_width# + 2side_bearing# - display_shift# - 2text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "partial integral dots";

    italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

    pair centre;

    centre := (1/2(w + script_delta), (h-d)/2);

    z0 = centre + 1/2scale * order_width * left;
    z1 = centre;
    z2 = centre + 1/2scale * order_width * right;

    fill circle(z0, dot_size);
    fill circle(z1, dot_size);
    fill circle(z2, dot_size);
  endchar;
endfor;
charlist current_char - 1: current_char;

for sign = 1, -1:
  for scale = 1, 1.8:

    display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
    text_shift#    := -4/8order_width# + 5/4(scale-1) * 2/8order_width#;
    script_delta#  := (1/2 + 4/2(scale-1)) * 1/2order_width#;
    define_whole_pixels(display_shift, text_shift, script_delta);

    beginsymbol(scale * 1/2 * order_width# + 2side_bearing# - display_shift# - 2text_shift#,
                ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
      "partial landup/down integral";

      italcorr script_delta#; % kerning between upper limit and lower limit

      pair centre;

      centre := (1/2(w + script_delta), (h-d)/2);

      pickup pencircle scaled 1/2thick;

      z0 = centre + sign * sqrt scale * (-2thick, -2/3thick);
      z1 = centre + sign * sqrt scale * ( 0,       2/3thick);
      z2 = centre + sign * sqrt scale * ( 2thick, -2/3thick);

      draw z0 .. z1 .. z2;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for scale = 1, 1.8:

  display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := -4/8order_width# + 5/4(scale-1) * 2/8order_width#;
  script_delta#  := (1/2 + 4/2(scale-1)) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift, script_delta);

  beginsymbol(scale * 1/2 * order_width# + 2side_bearing# - display_shift# - 2text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "partial stroked integral";

    italcorr script_delta#; % kerning between upper limit and lower limit

    pair centre;

    centre := (1/2(w + script_delta), (h-d)/2);

    alpha := 10;

    pickup pencircle scaled 1/2thick;

    draw (centre - sqrt scale * 2thick * dir alpha) -- (centre + sqrt scale * 2thick * dir alpha);
  endchar;
endfor;
charlist current_char - 1: current_char;

for number = 0, 1:
  for scale = 1, 1.8:

    display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
    text_shift#    := -4/8order_width# + 5/4(scale-1) * 2/8order_width#;
    script_delta#  := (1/2 + 4/2(scale-1)) * 1/2order_width#;
    define_whole_pixels(display_shift, text_shift, script_delta);

    beginsymbol(scale * (1/2 + 2/3number) * order_width# + 2side_bearing# - display_shift# - 2text_shift#,
                ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
      "partial contour integral";

      italcorr script_delta#; % kerning between upper limit and lower limit

      pair centre;

      centre := (1/2(w + script_delta), (h-d)/2);

      pickup pencircle scaled (5/12thick * sqrt scale);

      if number = 0:
        draw circle(centre, 2thick * sqrt scale);
      else:
        draw super_ellipse(centre,
                           (2thick + number * 5/5thick) * sqrt scale,
                           (2thick + number * 1/5thick) * sqrt scale,
                           7/8, 0);
      fi;
    endchar;
  endfor;
  charlist current_char - 1: current_char;
endfor;

for alpha = -90, 90:
  for sign = 1, -1:
    for scale = 1, 1.8:

      display_shift# := 0;%(1 + 5/2(scale-1)) * 1/4order_width#;
      text_shift#    := -4/8order_width# + 5/4(scale-1) * 2/8order_width#;
      script_delta#  := (1/2 + 4/2(scale-1)) * 1/2order_width#;
      define_whole_pixels(display_shift, text_shift, script_delta);

      beginsymbol(scale * 1/2order_width# + 2side_bearing# - display_shift# - 2text_shift#,
                  ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
                  (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
        "partial oriented contour integral";

        italcorr script_delta#; % kerning between upper limit and lower limit

        pair centre;
        centre := (1/2(w + script_delta), (h-d)/2);

        pickup pencircle scaled (5/12thick * sqrt scale);

        r := 2thick * sqrt scale;

        beta := alpha + 80 + 25sign;

        reg_poly_points(a)(8, centre, r, beta);

        z0 = centre + r * dir (beta + 10);
        z1 = centre + r * dir (beta - 10);

        draw z0{dir (beta + 100)} .. z.a1 .. z.a2 .. z.a3 .. z.a4 .. z.a5 .. z.a6 .. z.a7 ..
            {dir (beta + 80)}z1;

        if sign > 0:
          draw arrowhead(z1, (beta + 65), 1/2scale * arrow_spread);
        else:
          draw arrowhead(z0, (beta - 65), 1/2scale * arrow_spread);
        fi;
      endchar;
    endfor;
    charlist current_char - 1: current_char;
  endfor;
endfor;

for scale = 1, 1.8:

  display_shift# := (1 + 5/2(scale-1)) * 1/4order_width#;
  text_shift#    := (scale-1) * 1/2order_width#;
  define_whole_pixels(display_shift, text_shift);

  beginsymbol(scale * 1/2order_width# + 2side_bearing# + display_shift# - text_shift#,
              ((scale - 1)/2 + 1) * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#,
              (scale - 1)/2 * 1.4asc_height# + scale * 1/6equal_spread# + 2/3rule_thickness#);
    "partial sum integral";

    italcorr (1 + 3/2(scale-1)) * 2/3order_width#; % kerning between upper limit and lower limit

    pair centre;

    z0 = (1/2(w + script_delta), (h-d)/2);

    penpos0(4/5thick, 0);

    draw_sum(a, 1/3[z0l,z0r], scale * order_width, 3/4scale * asc_height, 1/2thick * sqrt scale);

  endchar;
endfor;
charlist current_char - 1: current_char;

for scale = 1, 1.4:
  beginbigop(3/4scale, scale); "complement";

    pickup pencircle scaled (4/3rule_thickness * sqrt scale);

    z0 = centre + op_height/2 * up;
    z1 = centre - op_height/2 * up;
    z2 = centre - op_width/2 * right;
    z3 = centre + op_width/2 * right;

    draw (1/4[z0,z1] + op_width/2 * right){up}
      .. z0
      .. {down}(1/3[z0,z1] - op_width/2 * right)
      -- (2/3[z0,z1] - op_width/2 * right){down}
      .. z1
      .. (3/4[z0,z1] + op_width/2 * right){up};
  endchar;
endfor;
charlist current_char - 1: current_char;