summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/mathabx/mathcall.mf
blob: 54c2c06236e0de357154a28747dddf9b8a10ba3b (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
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
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
% mathematical symbols by Anthony Phan.
% file: mathcall.mf (calligraphic font)
% last modification: May 16, 2005.

%
% LOWERCASE
%
% design, metrics and italic corrections checked (nov. 28, 2002).
%

cmchar "Calligraphic a";
beginchar("a", 9u#, x_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    x_height#*slant+0.5lower_cal_width#-2u#) if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = vround 0.98h; x1 = x2 = good.x(w-2.5u); x4 = w;
  draw z1..hook_out(2, 3, 4);
  top y6 = x_height+oo; bot y8 = -oo; y5 = y7 = 0.5[y6, y8];
  x5 = x1; x7 = good.x(1.25u); x6 = x8 = 0.5[x5, x7];
  draw z5 up_to_left z6 left_to_down z7
  down_to_right z8 right_to_up z5;
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic b";
beginchar("b", 8u#, asc_height#, 0);
  italcorr .75x_height#*slant+0.5curve#-u# if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; y2 = 0.5x_height; bot y3 = -oo;
  y4 = 0.5x_height; top y5 = x_height+oo;
  x1 = x2 = good.x 1.5u; x3 = 0.5[x2, x4];
  x4 = good.x(w-1.25u); x5 = 0.5[x2, x4];
  draw z1-cal.extension--z1..z2{down}
  ...z3{right}...z4{up}...z5{left}...z2{down};
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5);
endchar;

cmchar "Calligraphic c";
beginchar("c", 8u#, x_height#, 0);
  italcorr max(0.25x_height#*slant+0.5lower_cal_width#, 
    0.85x_height#*slant+0.5lower_cal_width#-1.1u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x2-x1 = hround u; rt x2 = hround(w-1.1u);
  if x2 > w-1.25u: x2 := good.x w-1.25u; fi
  x3 = 0.6[x4, x2]; x4 = good.x 1.25u;
  x5 = 0.5[x4, x6]; x6 = good.x w;
  top y3 = h+oo; y4 = .5h; bot y5 = -oo;
  y1 = good.y 0.65[y5, y3]; y2 = .8[y5, y3];
  y6 = good.y 1/4x_height;
  draw z1 ... z2 up_to_left z3 left_to_down
  z4 down_to_right z5...z6;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6);
endchar;

cmchar "Calligraphic d";
beginchar("d", 9u#, asc_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    h#*slant+0.5lower_cal_width#-2u#) if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; x1 = x2 = good.x(w-2.5u); x4 = w;
  draw z1-cal.extension--z1---hook_out(2, 3, 4);
  top y6 = x_height+oo; bot y8 = -oo; y5 = y7 = 0.5[y6, y8];
  x5 = x1; x7 = good.x(1.25u); x6 = x8 = 0.5[x5, x7];
  draw z5 up_to_left z6 left_to_down z7
  down_to_right z8 right_to_up z5;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic e";
beginchar("e", 8u#, x_height#, 0);
  italcorr max(0.25x_height#*slant+0.5lower_cal_width#, 
    0.85x_height#*slant+0.5lower_cal_width#-1.1u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  rt x1 = hround(w-1.1u); x2 = 0.6[x3, x1];
  if x1 > w-1.25u: x1 := good.x w-1.25u; fi
  x3 = good.x 1.25u; x4 = 0.5[x3, x5]; x5 = good.x w;
  y1 = 0.8[y4, y2]; top y2 = h+oo; y3 = .5h; bot y4 = -oo;
  y5 = good.y 1/4x_height;
  draw z3 right_to_up z1 up_to_left z2
  left_to_down z3 down_to_right z4...z5;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5);
endchar;

cmchar "Calligraphic f";
beginchar("f", 5.5u#, asc_height#, desc_depth#);
  italcorr asc_height#*slant+.75u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  z88 = (0.5w-0.5u, h); z89 = (0.5w+0.5u, -d);
  top y2 = h+oo; bot y5 = -d-oo; top y8 = top y9 = x_height;
  y2-y0 = y6-y5 = vround 0.35min(d, h-x_height);
  y1 = 0.5[y0, y2]; y6 = 0.5[y5, y7];
  y3 = 0.25[x_height, y2]; y4 = 0.5[y5, y3];
  rt x1-w = -lft x6 = hround 0.25u; x7-x6 = hround 0.5u;
  x0 = x1; x2 = 0.4[x1, x3]; x5 = 0.4[x6, x4];
  z3 = whatever[z88, z89]; z4 = whatever[z88, z89];
  lft x8 = hround(lft x3-0.5stem-1.25u);
  rt x9 = hround(rt x3+0.5stem+1.7u);
  draw (z0--z1) softjoin (z1 up_to_left z2....z3
    ---z4....z5{left}...z6);%...z7);
  draw z8..z9;
  %
  math_fit(desc_depth#*slant+u#, x_height#*slant);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic g";
beginchar("g", 8u#, x_height#, desc_depth#);
  italcorr x_height#*slant+0.5lower_cal_width#-u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = vround 0.98h;
  top y6 = x_height+oo; bot y8 = -oo; y5 = y7 = 0.5[y6, y8];
  x1 = x2 = x5 = good.x(w-1.5u); x4 = 1.5u;
  x7 = good.x(1.25u); x6 = x8 = 0.5[x5, x7];
  draw z1..desc_curve(2, 3, 4);
  draw z5 up_to_left z6 left_to_down z7
  down_to_right z8 right_to_up z5;
  %
  math_fit(-min(.3x_height#*slant+0.5curve#-u#, 
      1.5u#-desc_depth#*slant), ic#-1/3x_height#*slant);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic h";
beginchar("h", 9u#, asc_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    0.75x_height#*slant+0.5lower_cal_width#-2u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; bot y2 = -oo;
  x1 = x2 = good.x 1.5u;
  x4 = w-2.45u; x5 = w-2.80u; x7 = w;
  draw z1-cal.extension--z1--z2
  --ital_arch(2, 3, 4)...hook_out(5, 6, 7);
  %
  math_fit(0, ic#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic i";
beginchar("i", 5u#, min(10/7x_height#+0.5flare#, asc_height#), 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    (h#-0.5flare#)*slant
    -2.5u#-0.4(h#-x_height#)*slant+0.5flare#+0.5u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(0.5w+0.30u);
  x4 = good.x(0.5w-0.30u); x6 = w;
  draw hook_in(1, 2, 3)...hook_out(4, 5, 6);
  %
  pickup fine_cal.nib;
  cal_dot7(0.5w-0.4(h-x_height)*slant, h+1-0.5flare, flare);
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 5, 6); penlabels(7, 7');
endchar;

cmchar "Calligraphic j";
beginchar("j", 5u#, min(10/7x_height#+0.5flare#, asc_height#), desc_depth#);
  italcorr max(0.8x_height#*slant+0.5lower_cal_width#-u#, 
    (h#-0.5flare#)*slant
    -1.5u#+0.5lower_cal_width#-0.6(h#-x_height#)*slant+0.5u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x(w-1.5u);
  x6 = good.x 0; x0 = rt x3;
  draw hook_in(1, 2, 3)..desc_curve(4, 5, 6);
  %
  pickup fine_cal.nib;
  cal_dot7(x0-0.5flare-0.6(h-x_height)*slant, h+1-0.5flare, flare);
  %
  math_fit(desc_depth#*slant, x_height#*slant+0.5stem#-u#);
  labels(1, 2, 3, 4, 5, 6); penlabels(7, 7');
endchar;

cmchar "Calligraphic k";
beginchar("k", 8.5u#, asc_height#, 0);
  italcorr max(0.2x_height#*slant+0.1w#, 
    0.95x_height#*slant-0.1w#+0.5u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; bot y2 = -oo; x1 = x2 = good.x 1.5u;
  draw z1-cal.extension--z1--z2;
  %
  rt x4 = .9w; x5 = x4-.1w; x7 = .8w; rt x8 = 1.1w;
  y4 = .9x_height; top y5 = x_height+oo; bot y7 = -oo; y8 = .2x_height-oo;
  (lft z6)t_ = (x2, 0.4x_height).t_+penoffset up of pen_[lower_cal.nib];
  draw z4{up}...{left}z5..tension atleast 2..{down}z6
  ..tension atleast 3 and atleast 2..z7{right}...{up}z8; % diagonals
  %
  math_fit(0, 1/3x_height#*slant+0.5hair#+0.5u#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic l";
beginchar("l", 4.5u#, asc_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    asc_height#*slant+0.5lower_cal_width#-2.1u#) if math_fitting: +0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; x1 = x2 = good.x 1.9u; x4 = w;
  draw z1-cal.extension--z1---hook_out(2, 3, 4);
  %
  math_fit(-0.5u#, 1/3x_height#*slant+0.5hair#+u#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic m";
beginchar("m", 15u#, x_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    0.75x_height#*slant+0.5lower_cal_width#-2u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x 2.5u; x6 = x7 = good.x 0.5w;
  x9 = good.x(w-2.45u); x10 = good.x(w-2.80u); x12 = w;
  bot y4 = bot y7 = -oo;
  draw hook_in(1, 2, 3)---z4;
  draw ital_arch(4, 5, 6)---z7;
  draw ital_arch(7, 8, 9)...hook_out(10, 11, 12);
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
endchar;

cmchar "Calligraphic n";
beginchar("n", 10u#, x_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    0.75x_height#*slant+0.5lower_cal_width#-2u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x 2.5u; bot y4 = -oo;
  x6 = good.x(w-2.45u); x7 = good.x(w-2.80u);
  x9 = w;
  draw hook_in(1, 2, 3)---z4;
  draw ital_arch(4, 5, 6)...hook_out(7, 8, 9);
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
endchar;

cmchar "Calligraphic o";
beginchar("o", 9u#, x_height#, 0);
  italcorr .7x_height#*slant+0.5lower_cal_width#-u#
  if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);%(-0.25u#, -0.25u#);
  %
  pickup lower_cal.nib;
  top y1 = h+oo; bot y3 = -oo; y2 = y4 = 0.5[y1, y3];
  x2 = good.x 1.25u; x4 = good.x(w-1.25u); x1 = x3 = 0.5[x2, x4];
  draw z1 left_to_down z2 down_to_right
  z3 right_to_up z4 up_to_left z1;
  % not good
%  x5 = good.x 0.75[x2, x1]; x6 = 0.5[x5, x7]; x7 = good.x w;
%  y5 = 0.75[y6, y1]; y6 = good.y 0.6[y3, y1]; y7 = good.y 3/4x_height;
%  draw z1{left}...z5 down_to_right z6...z7;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic p";
beginchar("p", 9u#, x_height#, desc_depth#);
  italcorr .7x_height#*slant+0.5lower_cal_width#-u#
  if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x 2.5u; bot y4 = -d-eps;
  draw hook_in(1, 2, 3)..z4;
  top y6 = x_height+oo; bot y8 = -oo; y5 = y7 = 0.5[y6, y8];
  x5 = good.x(w-1.25u); x7 = x3; x6 = x8 = 0.5[x5, x7];
  draw z5 up_to_left z6 left_to_down z7
  down_to_right z8 right_to_up z5;
  %
  math_fit(-min(2/3x_height#*slant-0.5hair#-0.5u#, 
      2u#-0.5stem#-desc_depth#*slant), ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic q";
beginchar("q", 8u#, x_height#, desc_depth#);
  italcorr x_height#*slant+0.5lower_cal_width#-u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = vround 0.98h; bot y2 = -d-eps;
  x1 = x2 = good.x(w-1.5u);
  draw z1--z2--z2+cal.extension;
  top y6 = x_height+oo; bot y8 = -oo; y5 = y7 = 0.5[y6, y8];
  x5 = x1; x7 = good.x(1.25u); x6 = x8 = 0.5[x5, x7];
  draw z5 up_to_left z6 left_to_down z7
  down_to_right z8 right_to_up z5;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#-1/3x_height#*slant);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic r";
beginchar("r", 7.25u#, x_height#, 0);
  italcorr 0.8x_height#*slant+0.5lower_cal_width#-0.15u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x 2.5u; bot y4 = -oo;
  draw hook_in(1, 2, 3)---z4;
  y5 = y2; y7 = good.y 0.65[y4, y5]; y6 = .8[y4, y5];
  x6 = good.x(w-0.65u); x6-x7 = hround 0.75u; x5 = 0.75[x4, x6];
  draw z4{up}...z5 right_to_down z6...z7;
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#-0.5u#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic s";
beginchar("s", 5.25u#+1.75u#, x_height#, 0);
  italcorr 0.9x_height#*slant-0.05w#+0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  rt x0 = rt x1 = .95w; x2 = .5[x3, x1]; lft x3 = .15w; x4 = .5[x6, x2];
  rt x5 = w; x6 = .5w; lft x7 = 0; lft x8 = .075w;
  y0 = .8h; y1 = .9h; top y2 = h+o; y3 = .55[y4, y2]; y4 = .55[y6, y2];
  y5 = .45[y6, y4]; bot y6 = -o; y7 = .2h; y8 = .35h;
  draw\\(z0--z1) softjoin (z1...z2{left}...z3{down}...z4...z5{down}
    ...z6{left}...z7) softjoin (z7{up}...{right}z8); % stroke
  math_fit(0, ic#);
  labels(0, 1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic t";
beginchar("t", 5.5u#, min(asc_height#, 10/7x_height#), 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    x_height#*slant-.25u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h; x1 = x2 = good.x 2u; x4 = w;
  draw z1---hook_out(2, 3, 4);
  lft x5 = hround -0.75u; rt x6 = hround(w-0.65u);
  top y5 = top y6 = x_height;
  draw z5..z6;
  %
  math_fit(1.25u#-x_height#*slant, ic#);
  labels(1, 2, 3, 4, 5, 6);
endchar;

cmchar "Calligraphic u";
beginchar("u", 9.5u#, x_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    x_height#*slant+0.5lower_cal_width#-2u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(2.80u); x4 = good.x(2.3u);
  x5 = 0.5[x4, x6]; x6 = x7 = x8 = good.x(w-2.5u); x10 = w;
  y4 = 0.7[y5, y6]; bot y5 = -oo; y6 = 0.57h; top y7 = h;
  draw hook_in(1, 2, 3)...z4 down_to_right z5...z6{up};
  draw z7..hook_out(8, 9, 10);
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 6, 7, 8, 9, 10);
endchar;

%cmchar "Calligraphic v";
% beginchar("v", 8u#, x_height#, 0);
%   italcorr 0.8x_height#*slant;
%   adjust_fit(0, 0.5u#);
%   %
%   pickup lower_cal.nib;
%   x1 = 0; top y1 = h; z3 = (.48w, 0);
%   z0.t_ = z2.t_+penoffset down of currentpen
%   = z3.t_+penoffset down of pen_[tilted.nib];
%   draw z1{right}..tension atleast 1 and infinity..z2; % left diagonal
%   pickup tilted.nib;
%   rt x4 = w; x5 = x4-.2w; top y4 = .8h; top y5 = h;
%   path p; p = z3..tension atleast 3 and 1..{up}z4;
%   erase fill z0--(x0, y0-0.5h)--(x4, y0-0.5h)--(x4+eps, y4)--reverse p--cycle;
%   draw p...{left}z5; % right diagonal
%   %
%   math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, 2/3ic#);
%   labels(0, 1, 2, 3, 4, 5);
% endchar;

cmchar "Calligraphic v";
beginchar("v", 8.75u#, x_height#, 0);
  italcorr .7x_height#*slant+0.5lower_cal_width#-u#
  if math_fitting: -0.5u# fi; % same as "o"
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(2.80u); x4 = good.x(2.3u);
  x5 = 0.5[x4, x6]; x6 = good.x(w-1.25u); x7 = good.x(w-2.25u);
  y4 = 0.7[y5, y6]; bot y5 = -oo; y6 = 0.57h; top y7 = h+oo;
  draw hook_in(1, 2, 3)...z4 down_to_right z5...z6{up}...z7;
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic w";
% beginchar("w", 12.3u#, x_height#, 0);
%   italcorr 0.8x_height#*slant;
%   adjust_fit(0.2u#, 0.5u#);
%   %
%   pickup lower_cal.nib;
%   x1 = 0; x3 = .5[x1, x6]; x6 = .52w;
%   x9 = .58[x6, x10]; y3 = y9 = 0; top y1 = top y6 = h;
%   z7 = .5[z8, z6]+bend; z4 = .5[z3, z5]+bend;
%   (z0)t_ = (z2)t_+penoffset down of currentpen
%   = (z3)t_+penoffset down of pen_[tilted.nib];
%   (z20)t_ = (z8)t_+penoffset down of currentpen
%   = (z9)t_+penoffset down of pen_[tilted.nib];
%   draw z1{right}..tension atleast 1 and infinity..z2; % first diagonal
%   pickup tilted.nib;
%   x5 = x6; rt x10 = w;
%   x11 = x10-.1w; top y5 = h; top y10 = .8h; top y11 = h;
%   erase fill z0--(x0, y0-0.5h)--(x5, y0-0.5h)--z5..z4..z3--cycle;
%   draw z3..z4..z5; % second diagonal
%   pickup lower_cal.nib;
%   erase fill\\(.3w, bot y6)--(w, bot y6)--(w, top y6)--(.3w, top y6)--cycle;
%   draw z6..z7..z8; % third diagonal
%   pickup tilted.nib;
%   path p; p = z9..tension atleast 3 and 1..{up}z10;
%   erase fill z20--(x20, y20-0.5h)--(x10, y20-0.5h)--(x10+eps, y10)
%   --reverse p--cycle;
%   draw p..{left}z11; % fourth diagonal
%   %
%   math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, 3/4ic#);
%   labels(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20);
% endchar;

cmchar "Calligraphic w";
beginchar("w", 12.5u#, x_height#, 0);
  italcorr .7x_height#*slant+0.5lower_cal_width#-u#
  if math_fitting: -0.5u# fi; % same as "o"
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(2.80u); x4 = good.x(2.3u);
  x5 = 0.5[x4, x6]; x6 = x7 = good.x 0.5[2.5u,w-1.5u]; x8 = 0.5[x6,x9];
  x9 = good.x(w-1.25u); x10 = good.x(w-2.25u);
  y4 = 0.7[y5, y6]; bot y5 = bot y8 = -oo; y6 = y9 = 0.57h;
  top y7 = top y10 = h+oo;
  draw hook_in(1, 2, 3)...z4 down_to_right z5...z6---z7;
  draw z6 down_to_right z8...z9{up}...z10;
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic x";
beginchar("x", 8.25u#, x_height#, 0);
  italcorr max(1/9x_height#*slant, 0.9x_height#*slant+.5u#);
  adjust_fit(0, 0.25u#);
  %
  pickup lower_cal.nib;
  lft x1 = .08w; lft x2 = .2w; x4-x3 = x2-x1; rt x4 = w;
  h-y1 = y4 = 1/9h; top y2 = h; bot y3 = 0;
  draw z1{up}....z2{right}
  ... .2[z2+(.1w, 0), z3-(.1w, 0)]---.8[z2+(.1w, 0), z3-(.1w, 0)]
  ...{right}z3....{up}z4; % left diagonal
  x5 = x6-u; rt x6 = w; lft x7 = 0; x8 = x7+u;
  top y5 = h; y6 = .85h; y7 = h-y6; bot y8 = 0;
  draw z5{right}...z6{down}
  ..tension atleast 3..{down}z7...{right}z8; % right diagonal
  %
  math_fit(0, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

cmchar "Calligraphic y";
beginchar("y", 8.5u#, x_height#, desc_depth#);
  italcorr x_height#*slant+0.5lower_cal_width#-0.5u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(2.80u); x4 = x10 = good.x(2.3u);
  x5 = 0.5[x4, x6]; x6 = x7 = x8 = good.x(w-1.5u);
  y4 = 0.7[y5, y6]; bot y5 = -oo; y6 = 0.57h; top y7 = h;
  draw hook_in(1, 2, 3)...z4 down_to_right z5...z6{up};
  draw z7..desc_curve(8, 9, 10);
  %
  math_fit(-2/3x_height#*slant+0.5hair#+0.5u#, ic#-1/3x_height#*slant);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
endchar;

cmchar "Calligraphic z";
beginchar("z", 5.5u#+max(1.5u#, stem#), x_height#, 0);%desc_depth#);
  italcorr x_height#*slant+0.5lower_cal_width#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  y1 = good.y 3/4x_height;
  top y2 = h+oo; top y3 = vround 0.98h+eps;
  bot y4 = -oo; bot y5 = -oo;
  y6 = good.y 1/4x_height;
  x1 = x4 = good.x u; x6 = good.x w; x6-x3 = hround 0.5u;
  x2 = 0.25[x1, x3]; x5 = 0.25[x6, x4];    
  draw z1 ... z2{right}..{z3-z4}z3
  --z4{z3-z4}..z5{right}... z6;
  %
  math_fit(0, 1/3x_height#*slant+0.5hair#+0.5u#);
  labels(1, 2, 3, 5, 6);
endchar;

%
% LATIN EXTENSION
%
% the three first have been checked: design, metrics
% and italic corrections (nov. 28, 2002).
%

cmchar "Calligraphic dotless i";
beginchar(hex"10", 5u#, x_height#, 0);% height
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    0.8x_height#*slant+0.5lower_cal_width#-1.7u#);
  italcorr 1/3x_height#*slant+0.5hair#+0.5u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = good.x(0.5w+0.30u);
  x4 = good.x(0.5w-0.30u); x6 = w;
  draw hook_in(1, 2, 3)...hook_out(4, 5, 6);
  %
  math_fit(0, 0);
  labels(1, 2, 3, 4, 5, 6, 7);
endchar;

cmchar "Calligraphic dotless j";
beginchar(hex"11", 5u#, x_height#, desc_depth#);
  italcorr max(0.8x_height#*slant+0.5lower_cal_width#-u#, 
    0.8x_height#*slant+0.5lower_cal_width#-0.5u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = 0; x3 = x4 = good.x(w-1.5u);
  x6 = good.x 0;
  draw hook_in(1, 2, 3)..desc_curve(4, 5, 6);
  %
  math_fit(0, 0);
  labels(1, 2, 3, 4, 5, 6);
endchar;

cmchar "Calligraphic es-zet";
beginchar(oct"31", 8u#, asc_height#, desc_depth#);
  italcorr max(.8h#*slant-.1w#, .5x_height#*slant)+.5u#;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  x1 = x3 = good.x 1.5u; x4 = .6[x2, x5]; rt x5 = .9w; x6 = .4w;
  rt x7 = w;
  x8 = .4[x9, x7]; lft x9 = rt x3;
  top y1 = x_height+oo; bot y3 = -d-eps; z2 = .3[z3, z1]+bend;
  top y4 = h+oo; y5 = .6[y6, y4]; y6 = .55h; y7 = .45[y8, y6];
  bot y8 = -oo; y9 = .1h;
  draw z1-cal.extension--flex(z1, z2, z3);  % stem
  draw z2{up}...z4...z5{down}...{dir 200}z6{dir 10}
  ...z7{down}...z8{left}...z9;  % lobes
  %
  math_fit(.5u#, .3h#*slant+.5u#);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9);
endchar;

cmchar "Calligraphic ae";
beginchar(oct"32", 13u#, x_height#, 0);
  italcorr max(0.25x_height#*slant+0.5lower_cal_width#, 
    0.85x_height#*slant+0.5lower_cal_width#-1.1u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h+oo; bot y3 = -oo; y2 = y4 = 0.5[y1, y3];
  x2 = good.x 1.25u; x4 = good.x 0.5w;
  x1 = 0.5[x2, x4]; x3 = 0.5[x2, x4];
  draw z1 left_to_down z2 down_to_right
  z3 right_to_up z4 up_to_left z1;
  %
  rt x5 = hround(w-1.1u); x6 = 0.6[x7, x5];
  if x5 > w-1.25u: x5 := good.x w-1.25u; fi
  x7 = x4; x8 = 0.5[x7, x9]; x9 = good.x w;
  y5 = 0.8[y8, y6]; top y6 = h+oo; y7 = .5h; bot y8 = -oo;
  y9 = good.y 1/4x_height;
  draw z7 right_to_up z5 up_to_left z6
  left_to_down z7 down_to_right z8...z9;
  %
  top y10=vround 0.98h; bot y11=0;
  x10=x11=x4; draw z10..z11;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
endchar;

cmchar "Calligraphic oe";
beginchar(oct"33", 13u#, x_height#, 0);
  italcorr max(0.25x_height#*slant+0.5lower_cal_width#, 
    0.85x_height#*slant+0.5lower_cal_width#-1.1u#);
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = h+oo; bot y3 = -oo; y2 = y4 = 0.5[y1, y3];
  x2 = good.x 1.25u; x4 = good.x 0.5w; x1 = x3 = 0.5[x2, x4];
  draw z1 left_to_down z2 down_to_right
  z3 right_to_up z4 up_to_left z1;
  %
  rt x5 = hround(w-1.1u); x6 = 0.6[x7, x5];
  if x5 > w-1.25u: x5 := good.x w-1.25u; fi
  x7 = x4; x8 = 0.5[x7, x9]; x9 = good.x w;
  y5 = 0.8[y8, y6]; top y6 = h+oo; y7 = .5h; bot y8 = -oo;
  y9 = good.y 1/4x_height;
  draw z7 right_to_up z5 up_to_left z6
  left_to_down z7 down_to_right z8...z9;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9);
endchar;

cmchar "Calligraphic o/slash";
beginchar(oct"34", 9u#, x_height#+0.5desc_depth#, 0.5desc_depth#);
  italcorr .7x_height#*slant+0.5lower_cal_width#-u#
  if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);%(-0.25u#, -0.25u#);
  %
  pickup lower_cal.nib;
  top y1 = x_height+oo; bot y3 = -oo; y2 = y4 = 0.5[y1, y3];
  x2 = good.x 1.25u; x4 = good.x(w-1.25u); x1 = x3 = 0.5[x2, x4];
  draw z1 left_to_down z2 down_to_right
  z3 right_to_up z4 up_to_left z1;
  %
  pickup fine_cal.nib;
  x5=good.x x4; x6=good.x x2; top y5=h+eps; bot y6=-d-eps; draw z5..z6;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6);
endchar;

cmchar "Calligraphic AE";
beginchar(oct"35",18u#,cap_height#,0);
  italcorr max(h#*slant-.1w#,.2h#*slant)+.5u#;
  adjust_fit(0,0); pickup cal.nib;
  w':=hround 8.5u;
  x1=.9[x3,x2]; rt x2=.9w'+w-w'; x3=.6[x4,x2]; lft x4=.05w'+w-w';
  x5=.7[x6,x2]; lft x6=w-w'; x7=.5[x6,x8]; rt x8=w;
  y1=y2-.1h; y2=.9h+o; top y3=h+o; y4=.5[y5,y3];
  y5=.55h; y6=.6[y5,y7]; bot y7=-o; y8=.2h;
  %
  pickup tilted.nib;
  lft x4'=.05w'+w-w';
  w':=hround 14.4u;
  lft x1'=.05w'; x2'=.2w';
  y1'=y2'+.1h; bot y2'=bot_flourish_line;
  y3'=y6; z3'=whatever[z2',z4]+2bend; y4'=y4;
  draw\\(z1'..tension 1.2..{right}z2') softjoin (z2'...z3'...z4'{up});
% left diagonal
  pickup cal.nib;
  draw\\(z1{2(x2-x1),y2-y1}...z2)
  softjoin (z2...z3{left}...z4{down}...{right}z5);  % upper arc
  draw z5{left}...z6{down}...z7{right}...z8;  % lower arc
  draw rt z3'--z6;  % bar
  math_fit(.5u#-.2h#*slant,.2h#*slant+.5u#);
  labels(1',2',3',4',1,2,3,4,5,6,7,8);
endchar;

cmchar "Calligraphic OE";
beginchar(oct"36",16u#,cap_height#,0);
  italcorr max(h#*slant-.1w#,.2h#*slant)+.5u#;
  adjust_fit(0,0); pickup cal.nib;
  w':=hround 8.5u;
  x1=.9[x3,x2]; rt x2=.9w'+w-w'; x3=.6[x4,x2]; lft x4=.05w'+w-w';
  x5=.7[x6,x2]; lft x6=w-w'; x7=.5[x6,x8]; rt x8=w;
  y1=y2-.1h; y2=.9h+o; top y3=h+o; y4=.5[y5,y3];
  y5=.55h; y6=.6[y5,y7]; bot y7=-o; y8=.2h;
  draw\\(z1{2(x2-x1),y2-y1}...z2)
  softjoin (z2...z3{left}...z4{down}...{right}z5);  % upper arc
  draw z5{left}...z6{down}...z7{right}...z8;  % lower arc
  %
  w':=hround 12.6u;
  x1'=.3w'; lft x2'=0; x3'=0.6[x2',x6]; x5'=0.75[x2',x4];
  lft x6'=.27w';
  top y1'=top y5'=h+o; y2'=.55h; bot y3'=-o; y6'=y2';
  draw z1'...z2'{down}...z3'{right}...z6{up};
  save p; path p; p = z4{up}...z5'{left}...{down}z6';
  draw subpath (0,1.8) of p;
  math_fit(.5u#-.2h#*slant,.2h#*slant+.5u#);
  labels(1',2',3',5',6',1,2,3,4,5,6,7,8);
endchar;

cmchar "Calligraphic O/slash";
beginchar(oct"37",12.6u#,cap_height#+0.25desc_depth#, 0.25desc_depth#);
  italcorr .7h#*slant+.5u#;
  adjust_fit(0,0); pickup cal.nib;
  x1=.3w; lft x2=0; x3=.5w; rt x4=w; x5=.6w; lft x6=.27w;
  top y1=top y5=cap_height+o; y2=.55cap_height;
  bot y3=-o; y4=.5cap_height; y6=y2;
  path p; p=z1...z2{down}...z3{right}...z4{up}...z5{left}...{down}z6;
  draw subpath(0,4.8) of p;  % bowl
%  pickup .nib;
  top y7= vround(h+0.25desc_depth)+eps; bot y8=-hround(0.25desc_depth)-eps;
  x7 = good.x x4; x8 = good.x 0.1[x2, x6]; draw z7..z8;
  math_fit(.5u#-.3h#*slant,ic#-.5u#);
  labels(1,2,3,4,5,6);
endchar;

%
% DIGITS
%

beginchar("0", 9u#, fig_height#, 0);
  "The digit 0";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  numeric a; a = min(0.25h, 0.5(x_height-o));
  top y1 = h+o; bot y3 = -o; y2 = y4 = 0.5[y1, y3];
  lft x2 = hround max(0.7u, lft 1.45u); x4 = w-x2;
  x1 = x3 = 0.5[x2, x4];
  draw z1 left_to_down z2 down_to_right z3
  right_to_up z4 up_to_left z1;
  labels(1, 2, 3, 4);
  math_fit(0, 0.5ic#);
endchar;

beginchar("1", 9u#, fig_height#, 0);
  "The digit 1";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y2 = h+o; bot y3 = -max(hround(0.05h)+eps, oo); y1 = good.y 0.35[y2, y3];
  rt x2-lft x1 = hround 4.875u; rt x2 = w-hround 2.125u;
  rt x3 = w-hround 3.75u;
  draw z1{x2-x1, 0.5(y2-y1)}...z2 & z2{x3-x2, 0.4(y3-y2)}...{down}z3;
  labels(1, 2, 3);
  math_fit(0, 0.5ic#);
endchar;

beginchar("2", 9u#, fig_height#, 0);
  "The digit 2";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y2 = h+o; bot y5 = bot y6 = 0; y1 = y3 = good.y 0.75h;
  lft x1 = lft x5+eps = hround u; rt x3 = rt x6-eps = w-hround u;
  x2 = x4 = 0.5[x1, x3]; y4 = 0.4[y5, y3];
  draw z1 up_to_right z2 right_to_down z3...z4---z5--z6;
  labels(1, 2, 3, 4, 5, 6);
  math_fit(0, 0.5ic#);
endchar;

% beginchar("3", 9u#, fig_height#, 0);
%   "The digit 3";
%   italcorr fig_height#*slant-0.5u#;
%   adjust_fit(0, 0);
%   pickup lower_cal.nib;
%   bot y2 = -o; top y5 = top y6 = x_height;
%   y1 = good.y 1/4x_height;
%   y3 = a; y5-y4 = y3-y2; top y7 = top y8 = h;
%   rt x3 = w-hround u; x3 = x4 = x7+hround 0.5u-eps;
%   lft x1 = hround u; x1+hround 0.5u-eps = x8;
%   lft x6 = hround 3u-eps;
%   x2 = x5 = 0.5[x1, x3];
%   draw z1 ... z2 right_to_up z3..z4 up_to_left z5--z6--z7--z8;
%   labels(1, 2, 3, 4, 5, 6, 7, 8);
%   math_fit(0, 0.5ic#);
% endchar;

beginchar("3", 9u#,fig_height#,0);
  "The digit 3";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0,0); pickup lower_cal.nib;
  lft x2 = hround 1.25u; x3=.46[x2,x4]; x4=good.x(w-2u);
  x5=.7[x6,x2]; x6= good.x(w-1.25u); x7=.5[x6,x8]; lft x8 = hround u;
  x1=good.x 0.6[x5, x2];
  %y1=y2-.1h;
  y2=.85h+oo; top y3=h+oo; y4=.5[y5,y3];
  y5=good.y .55h; y6=.5[y5,y7]; bot y7=-oo; y8=good.y 1/4x_height;
  y1 = good.y 0.55[y5, y3];
  draw\\(z1{2(x2-x1),y2-y1}...z2)
  softjoin (z2...z3 right_to_down z4...{left}z5);  % upper arc
  draw z5 right_to_down z6...z7{left}...z8;  % lower arc
  math_fit(.5u#-.2h#*slant,.2h#*slant+.5u#);
  labels(1,2,3,4,5,6,7,8);
endchar;

beginchar("4", 9u#, fig_height#, 0);
  "The digit 4";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y1 = h+o; bot y5 = -max(hround(0.05h)+eps, oo); top y4 = x_height+eps;
  y2 = y3 = good.y(0.5x_height);
  rt x3 = w-hround 0.1u+eps;
  lft x2 = hround 0.5u-eps;
  x1 = good.x 0.33[x2, x3];
  x4 = good.x 0.725[x2, x3];
  x5 = good.x 0.475[x2, x3];
  draw z1{down}...z2--z3; draw z4{x5-x4, 0.45(y5-y4)}..z5{down};
  labels(1, 2, 3, 4, 5);
  math_fit(0, 0.5ic#);
endchar;

beginchar("5", 9u#, fig_height#, 0);
  "The digit 5";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  bot y2 = -o; top y4 = x_height+eps; y1 = good.y 1/4x_height;
  y3 = 0.5[y2, y4]; y5 = good.y 0.2[y4, y2]; top y6 = top y7 = h;
  rt x3 = w-hround u; x3 = x7+hround 0.5u-eps;
  lft x1 = hround u; x1+hround 0.5u = x5 = x6;
  x2 = x4 = 0.5[x1, x3];
  draw z1 ... z2 right_to_up z3
  up_to_left z4 ... z5&z5..{0.5(x6-x4), y6-y4}z6&z6..{x7-x5, 0.5(y7-y5)}z7;
  labels(1, 2, 3, 4, 5, 6, 7);
  math_fit(0, 0.5ic#);
endchar;

beginchar("6", 9u#, fig_height#, 0);
  "The digit 6";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y2 = h+o; bot y4 = -o; y1 = good.y(h-0.2x_height);
  top y6 = x_height+eps; y3 = 0.45[y4, y2]; y5 = 0.5[y4, y6];
  lft x3 = hround max(0.7u, lft 1.45u); x5 = w-x3;
  rt x1 = w-hround u; x2 = 0.6[x3, x1]; x4 = x6 = 0.5[x3, x5];
  draw z1 ... z2{left} ... z3 down_to_right z4
  right_to_up z5 up_to_left z6 ...z3;
  labels(1, 2, 3, 4, 5, 6);
  math_fit(0, 0.5ic#);
endchar;

beginchar("7", 9u#, fig_height#, 0);
  "The digit 7";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y2 = top y3 = h+o; bot y4 = -max(hround(0.05h)+eps, oo);
  y1 = good.y 0.3[y2, y4];
  lft x1 = lft x2 = hround 0.75u; rt x3 = w-hround 0.25u;
  x4 = good.x 0.4[x2, x3];
  draw z1{0.2(x3-x1), y3-y1}..z2 & z2{x4-x2, 0.2(y4-y2)}..z3
  &z3{x4-x3, 0.4(y4-y3)}..z4;
  labels(1, 2, 3, 4);
  math_fit(0, 0.5ic#);
endchar;

beginchar("8", 9u#, fig_height#, 0);
  "The digit 8";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  bot y1 = vround 0.5h; bot y4 = -o;
  y1-y2 = y1-y6 = y3-y4; y3 = y5 = a;
  lft x2 = lft x3 = hround u;
  rt x5 = rt x6 = w-hround u;
  x1 = x4 = x7 = 0.5[x2, x6];
  top y7 = h+o; y8 = y9 = 0.5[y7, y1];
  lft x8 = w-rt x9 = hround 1.4u-eps;
  draw z1 left_to_down z2..z3 down_to_right z4 right_to_up z5..z6
  up_to_left z1; draw superellipse(z9, z7, z8, z1, superness);
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9);
  math_fit(0, 0.5ic#);
endchar;

beginchar("9", 9u#, fig_height#, 0);
  "The digit 9";
  italcorr fig_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  bot y2 = -o; top y4 = h+o; y1 = good.y 0.2x_height;
  bot y6 = h-x_height-eps; y3 = 0.45[y4, y2]; y5 = 0.5[y4, y6];
  lft x5 = hround max(0.7u, lft 1.45u); x3 = w-x5;
  lft x1 = hround u; x2 = 0.6[x3, x1]; x4 = x6 = 0.5[x3, x5];
  draw z1 ... z2{right}... z3 up_to_left z4
  left_to_down z5 down_to_right z6 ...z3;
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9);
  math_fit(0, 0.5ic#);
endchar;

%
% PUNCTUATION
%

call_spanish_query:=0;
call_spanish_shriek:=1;
call_laquo:=2;
call_raquo:=3;

vardef complete_quote@#(expr $,$$)=
  pickup lower_cal.nib;
  bot y@#.c=hround 0.06h; y@#.b=good.y 0.5h; y@#.a-y@#.b=y@#.b-y@#.c;
  if $$<0: lft x@#.a=lft x@#.c=rt x@#.b-(hround 4u+2eps)=$;
  else: rt x@#.a=rt x@#.c=lft x@#.b+(hround 4u+2eps)=$; fi
  draw z@#.a{(z@#.b-z@#.a) yscaled 3}..z@#.b
  &z@#.b..{(z@#.c-z@#.b) yscaled 3}z@#.c;
  labels(@#.a,@#.b,@#.c);
enddef;

beginchar("<",8u#,x_height#,0);
  "French single opening quote";
  complete_quote1(w-hround 2u+eps,1);
endchar;

beginchar(">",8u#,x_height#,0);
  "French single closing quote";
  complete_quote1(hround 2u-eps,-1);
endchar;

beginchar(call_laquo,10u#,x_height#,0);
  "French double opening quote";
  complete_quote1(w-hround u+eps,1);
  complete_quote2(w-hround 4u+eps,1);
endchar;

beginchar(call_raquo,10u#,x_height#,0);
  "French double closing quote";
  complete_quote1(hround u-eps,-1);
  complete_quote2(hround 4u-eps,-1);
endchar;

cmchar "Hash mark (number sign)";
spread#:=math_spread[0.45x_height#,0.55x_height#];
spread:=2ceiling(spread#*hppp/2)+eps;
beginchar("#",15u#,asc_height#,asc_depth#);
  italcorr (math_axis#+.5(spread#+rth1#))*slant-.5u#;
  adjust_fit(0,0);
  pickup lower_cal.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 .5\\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;

cmchar "Plus sign";
beginchar("+",arithmetic_bounds);
  pickup lower_cal.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;

beginchar("*",9u#,body_height#,0);
  "Asterisk";
  italcorr body_height#*slant-u#;
  pickup lower_cal.nib;
  top y1=h+eps; bot y2=h-x_height-eps;
  x1=x2=good.x 0.5w;
  x3=good.x (x1-3u*cosd 30);
  x1-x3=x1-x6=x5-x1=x4-x1;
  y3=good.y (0.5[y1,y2]+3u*sind 30);
  y1-y3=y1-y5=y4-y2=y6-y2;
  draw z1..z2; draw z3..z4; draw z5..z6;
  labels(1,2,3,4,5,6);
endchar;

cmchar "Virgule (slash)";
beginchar("/",9u#,body_height#,paren_depth#);
  italcorr body_height#*slant-.5u#;
  pickup fine_cal.nib;
  rt x1=hround(w-u)+eps; top y1=h+eps;
  lft x2=hround u-eps; bot y2=-d-eps;
  draw z1--z2;  % diagonal
  labels(1,2);
endchar;

beginchar("=",14u#,v_center(spread#+rth1#));
  italcorr h#*slant-.5u#;
  adjust_fit(0,0); pickup lower_cal.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;

cmchar "Calligraphic dot";
beginchar(".", 5u#, dtsz#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  pickup fine_cal.nib;
  cal_dot1(0.5w, 0.5dtsz, dtsz);
  math_fit(0, 0);
  penlabels(1, 1');
endchar;

cmchar "Calligraphic comma";
beginchar(", ", 5u#, dtsz#, comma_depth#);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  cal_comma1(0.5w, 0.5dtsz, 1, -comma_depth);
  math_fit(0, 0);
endchar;

cal_apostrophe=hex"27"; cal_reverse_apostrophe=hex"60";
cal_opening_quotes=hex"5C"; cal_closing_quotes=hex"22";

cmchar "Calligraphic apostrophe";
beginchar(cal_apostrophe, 5u#, asc_height#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  cal_comma1(0.5w, h-0.5dtsz, 1, h-comma_depth-dtsz);
  math_fit(0, 0);
endchar;

cmchar "Calligraphic reverse apostrophe";
beginchar(cal_reverse_apostrophe, 5u#, asc_height#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  cal_comma1(0.5w, h-0.5dtsz-comma_depth, 
    -1, h);
  math_fit(0, 0);
endchar;

cmchar "Calligraphic opening quotes";
beginchar(cal_opening_quotes, 7u#+max(2u#, dtsz#), 
    asc_height#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  cal_comma1(w-0.6u-0.5dtsz, 
    h-0.5dtsz-comma_depth, -1, h);
  cal_comma2(w-0.6u-0.5dtsz-1.5u-max(2u, dtsz), 
    h-0.5dtsz-comma_depth, -1, h);
  math_fit(0, 0);
endchar;

cmchar "Calligraphic closing quotes";
beginchar(cal_closing_quotes, 7u#+max(2u#, dtsz#), 
    asc_height#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  cal_comma1(0.6u+0.5dtsz, 
    h-0.5dtsz, 1, h-dtsz-comma_depth);
  cal_comma2(0.6u+0.5dtsz+1.5u+max(2u, dtsz), 
    h-0.5dtsz, 1, h-dtsz-comma_depth);
  math_fit(0, 0);
endchar;

cmchar "Calligraphic semicolon";
beginchar(";", 5u#, x_height#, comma_depth#);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  pickup fine_cal.nib;
  cal_dot1(0.5w, h-0.5dtsz, dtsz);
  cal_comma2(0.5w, 0.5dtsz, 1, -comma_depth);
  math_fit(0, 0);
endchar;

cmchar "Calligraphic colon";
beginchar(":", 5u#, x_height#, 0);
  italcorr 0.5u#;
  adjust_fit(0, 0);
  pickup fine_cal.nib;
  cal_dot1(0.5w, 0.5dtsz, dtsz);
  cal_dot2(0.5w, h-0.5dtsz, dtsz);
  math_fit(0, 0);
  penlabels(1, 1', 2, 2');
endchar;

cmchar "Calligraphic hyphen";
beginchar("-", 6u#, x_height#, 0);
  italcorr 0.5x_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  y1 = y3 = good.y 0.5h;
  lft x1 = hround 0.2u-eps; rt x3 = hround(w-u)+eps;
  z2 = 0.5[z1, z3];
  draw z1{w, h}...z2{w, -0.5h}...z3{w, h};
  math_fit(0, 0);
  labels(1, 2, 3);
endchar;

cmchar "Calligraphic en-dash";
beginchar(oct"173", 9u#, x_height#, 0);
  italcorr 0.61803x_height#*slant+0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  y1 = y2 = good.y 0.61803h; lft x1 = -eps; rt x2 = w+eps;
  draw z1..z2; math_fit(0, 0); labels(1, 2);
endchar;

cmchar "Calligraphic em-dash";
beginchar(oct"174", 18u#, x_height#, 0);
  italcorr 0.61803x_height#*slant+0.5u#;
  adjust_fit(letter_fit#, letter_fit#);
  pickup lower_cal.nib;
  y1 = y2 = good.y 0.61803h; lft x1 = -eps; rt x2 = w+eps;
  draw z1..z2; math_fit(0, 0); labels(1, 2, 3);
endchar;

beginchar("(", 6u#, asc_height#, desc_depth#);
    italcorr asc_height#*slant;
    adjust_fit(0, 0);
    pickup med_cal.nib;
    top y1 = h; bot y3 = -d; y2 = 0.5(y1+y3);
    rt x1 = rt x3 = hround(w-0.5u); lft x2 = hround u;
    draw z1{x2-x1, 0.5(y2-y1)}...z2{down}...{x3-x2, 0.5(y3-y2)}z3;
    labels(1, 2, 3);
  endchar;

  beginchar(")", 6u#, asc_height#, desc_depth#);
  italcorr asc_height#*slant;
  adjust_fit(0, 0);
  pickup med_cal.nib;
  top y1 = h; bot y3 = -d; y2 = 0.5(y1+y3);
  lft x1 = lft x3 = hround(0.5u); rt x2 = hround(w-u);
  draw z1{x2-x1, 0.5(y2-y1)}...z2{down}...{x3-x2, 0.5(y3-y2)}z3;
  labels(1, 2, 3);
endchar;

beginchar("[", 6u#, asc_height#, desc_depth#);
  italcorr asc_height#*slant;
  adjust_fit(0, 0);
  pickup med_cal.nib;
  top y1 = top y2 = h; bot y4 = bot y5 = -d; y3 = 0.5[y1, y5]; 
  rt x1 = rt x5 = hround(w-0.25u); lft x2 = lft x4 = hround 1.25u;
  lft x3 = hround 1.5u;
  draw z1--z2...z3{down}...z4--z5;
  labels(1, 2, 3, 4, 5);
endchar;

beginchar("]", 6u#, asc_height#, desc_depth#);
  italcorr asc_height#*slant;
  adjust_fit(0, 0);
  pickup med_cal.nib;
  top y1 = top y2 = h; bot y4 = bot y5 = -d; y3 = 0.5[y1, y5]; 
  lft x1 = lft x5 = hround(0.25u); rt x2 = rt x4 = hround(w-1.25u);
  rt x3 = hround(w-1.5u);
  draw z1--z2...z3{down}...z4--z5;
  labels(1, 2, 3, 4, 5);
endchar;

beginchar("!", 5u#, asc_height#, 0);
  "Exclamation point";
  italcorr asc_height#*slant-2u#+0.5curve#;
  adjust_fit(0, 0);
  pickup med_cal.nib;
  x1=x2=good.x 0.5w;
  top y2= h+eps;
  cal_dot3(0.5w, 0.5dtsz, dtsz);
  bot y1=ceiling 0.25[top y3.b, x_height]-eps;
  draw z1..z2; labels(1, 2);
endchar;

beginchar(call_spanish_shriek, 5u#, asc_height#-desc_depth#, desc_depth#);
  "Spanish shriek";
  italcorr (charht-0.5dtsz#)*slant-2u#+0.5dtsz#;
  adjust_fit(0, 0);
  pickup med_cal.nib;
  x1=x2=good.x 0.5w;
  bot y2=-d-eps;
  cal_dot3(0.5w, h-0.5dtsz, dtsz);
  top y1=floor 0.25[bot y3.d, h-x_height]+eps;
  draw z1..z2; labels(1, 2);
endchar;

cmchar "Question mark";
beginchar("?", 9u#, asc_height#, 0);
  italcorr 0.8asc_height#*slant-0.5u#;
  pickup med_cal.nib;
  cal_dot9(0.5w, 0.5dtsz, dtsz);
  top y4 = h+oo; bot y7=ceiling 0.25[top y9.b, x_height]-eps;
  y2=good.y 0.5[y7, y4]; y3=y5=0.5[y2,y4]; y1= good.y 0.4[y2,y3];
  y6=1/9[y7,y4]; y8 = good.y 0.8[y7, y6];
  x3=good.x 1.5u; x5=good.x(w-1.25u); x4=0.55[x3,x5]; x7=0.5w;
  x1=good.x 0.5[x3,x5]; x2=0.25[x3,x5]; x6=good.x 2/3[x3,x4];
  x8=good.x 0.5[x7,x5];
  draw z1...z2 left_to_up z3 ...z4 right_to_down z5...z6 down_to_right z7...z8;
  labels(1, 2, 3, 4, 5, 6,7,8);
endchar;

beginchar(call_spanish_query, 9u#, asc_height#-desc_depth#, desc_depth#);
  "Spanish query";
  pickup med_cal.nib;
  cal_dot9(0.5w, h-0.5dtsz, dtsz);
  bot y4 = -d-oo; top y7=ceiling 0.25[bot y9.d, h-x_height]+eps;
  y2=good.y 0.5[y7, y4]; y3=y5=0.5[y2,y4]; y1=good.y 0.4[y2,y3];
  y6=1/9[y7,y4]; y8 = good.y 0.8[y7,y6];
  x3=good.x(w-1.5u); x5=good.x 1.25u; x4=0.55[x3,x5]; x7=0.5w;
  x1=good.x 0.5[x3,x5]; x2=0.25[x3,x5]; x6=good.x 2/3[x3,x4];
  x8=good.x 0.5[x7,x5];
  draw z1...z2 right_to_down z3 ...z4 left_to_up z5...z6 up_to_left z7...z8;
  labels(1, 2, 3, 4, 5, 6,7,8);
endchar;

% just look at italic corection and math fitting
cmchar "Calligraphic ampersand";
beginchar(oct"46", 14u#, asc_height#, 0);
  italcorr max(0.15x_height#*slant+0.5lower_cal_width#, 
    x_height#*slant+0.5lower_cal_width#-2u#) if math_fitting: -0.5u# fi;
  adjust_fit(0, 0);
  %
  pickup lower_cal.nib;
  top y1 = vround 0.98x_height;
  bot y2 = bot y7 = -oo;
  top y5 = h+oo;
  y3 = 0.5[y2, x_height]; y4 = y6 = 0.6[x_height, y5];
  y8 = good.y 7/8[x_height, y7];
  x1 = x7 = good.x(w-2.5u);
  x3 = good.x 1.25u; x6 = good.x 3u;
  x8 = good.x w; x2 = 5u; x4-x6=hround 3u; x5=0.6[x6,x4];
  draw z1{down}...z2 left_to_up z3...z4 up_to_left z5 left_to_down z6
  ...z7{right}...z8;
  %
  math_fit(-.3x_height#*slant+0.5curve#-u#, ic#);
  labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;

%
% ACCENTS
%

cmchar "Calligraphic grave accent";
beginchar(oct"22", 9u#, min(asc_height#, 2x_height#), 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup pencircle xscaled stem yscaled hair;
  top y1 = h+eps; bot y2 = vround 1/3[x_height, h]-eps;
  lft x1 = hround 1.75u; rt x2 = hround 2/3[x1, w-x1];
  draw z1{x2-x1, 2(y2-y1)}..z2;
  labels(1, 2);
endchar;

cmchar "Calligraphic acute accent";
beginchar(oct"23", 9u#, min(asc_height#, 2x_height#), 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup pencircle xscaled stem yscaled hair;
  top y1 = h+eps; bot y2 = vround 1/3[x_height, h]-eps;
  rt x1 = w-hround 1.75u; lft x2 = hround 2/3[x1, w-x1]; 
  draw z1{x2-x1, 2(y2-y1)}..z2;
  labels(1, 2);
endchar;

% HUM
cmchar "Calligraphic tilde accent";
beginchar(oct"176", 9u#, 
    min(asc_height#, 10/7x_height#+0.5flare#), 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  bot y4 = vround 1/3[x_height, h]-eps;
  top y2 = h+eps; y1 = y3 = y5 = good.y 0.5[y2, y4];
  lft x1 = w-rt x5 = hround 1.25u;
  x2 = 0.25[x1, x5]; x3 = 0.5[x1, x5]; x4 = 0.75[x1, x5];
  draw z1{(z2-z1) yscaled 2}...z2{right}...
  z3{(z4-z3)yscaled 2}...z4{right} ...{(z5-z4) yscaled 2}z5;
  labels(1, 2, 3, 4, 5);
endchar;

cmchar "Calligraphic circumflex accent";
beginchar(oct"136", 9u#, min(asc_height#, 2x_height#), 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup pencircle xscaled stem yscaled hair;
  top y2 = h+eps; bot y1 = bot y3 = vround 1/3[x_height, h]-eps;
  lft x1 = w-rt x3 = hround 1.75u; x2 = good.x 0.5[x1, x3];
  draw z1..{x2-x1, 2(y2-y1)}z2
  &z2{x3-x2, 2(y3-y2)}..z3;
  labels(1, 2, 3);
endchar;

cmchar "Calligraphic hacheck accent";
beginchar(oct"24", 9u#, min(asc_height#, 2x_height#), 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup pencircle xscaled stem yscaled hair;
  top y1 = top y3 = h+eps; bot y2 = vround 1/3[x_height, h]-eps;
  lft x1 = w-rt x3 = hround 1.75u; x2 = good.x 0.5[x1, x3];
  draw z1..{x2-x1, 2(y2-y1)}z2
  &z2{x3-x2, 2(y3-y2)}..z3;
  labels(1, 2, 3);
endchar;

cmchar "Calligraphic breve accent";
beginchar(oct"25", 9u#, min(asc_height#, 2x_height#), 0);
  "Breve accent";
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
%  pickup pencircle xscaled stem yscaled hair;
  pickup lower_cal.nib;
  top y1 = top y3=h+eps; bot y2=vround 1/3[x_height, h]-eps;
  lft x1 = w-rt x3=hround 1.5u; x2=0.5[x1, x3];
  draw z1 down_to_right z2 right_to_up z3; labels(1, 2, 3);
endchar;

cmchar "Calligraphic macron accent";
beginchar(oct"26", 9u#, 0.4[x_height#, asc_height#]+0.5hair#, 0);
  italcorr charht*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib; top y1 = top y2 = h;
  lft x1 = w-rt x2 = hround 1.25u;
  draw z1..z2; labels(1, 2);
endchar;

cmchar "Calligraphic circ accent";
beginchar(oct"27", 14.4u#
    +4/3(asc_height#-x_height#)*slant+1.5u#, 
    asc_height#, 0);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup fine_cal.nib;
  numeric a, b; b = vround(1/3[x_height, h]);
  a = round max(3.6u, h+o-b);
  top y2 = b+a+eps; bot y4 = b-eps;
  y0 = y1 = y3 = 0.5[y4, y2]; x0 = x2 = x4 = 0.5w;
  lft x3 = hround(x0-0.5a)-eps; x1-x0 = x0-x3;
  draw superellipse(z1, z2, z3, z4, superness);
  labels(1, 2, 3, 4, 0);
endchar;

cmchar "Calligraphic cedilla accent";
beginchar(oct"30", 9u#, 0, desc_depth#);
  italcorr asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  bot y1 = -oo; top y2 = -vround max(o, -d/6);
  bot y4 = -d; y3 = 0.5[y2, y4]; y5 = good.y 0.4[y4, y3];
  x1 = x2 = x4 = good.x 0.5w;
  lft x5 = w-rt x3 = hround 1.5u-eps;
  draw z1--z2 right_to_down z3 down_to_left
  z4 ... z5;
  labels(1, 2, 3, 4, 5);
endchar;

cmchar "Calligraphic dot accent";
beginchar(oct"137", 9u#, 
    min(asc_height#, 10/7x_height#+0.5flare#), 0);
  adjust_fit(0, 0);
  pickup fine_cal.nib; 
  cal_dot1(0.5w, h-0.5flare, flare);
  math_fit(0, 0);
  penlabels(1, 1');
endchar;

cmchar "Calligraphic umlaut accent";
beginchar(oct"177", 9u#, 
    min(asc_height#, 10/7x_height#+0.5flare#), 0);
  adjust_fit(0, 0);
  pickup fine_cal.nib;  
  cal_dot1(2.75u, h-0.5flare, flare);
  cal_dot2(w-2.75u, h-0.5flare, flare);
  math_fit(0, 0);
  penlabels(1, 1', 2, 2');
endchar;

cmchar "Calligraphic long umlaut accent";
beginchar(oct"175", 9u#, min(asc_height#, 2x_height#), 0);
  adjust_fit(0, 0);
  pickup pencircle xscaled stem yscaled hair;
  top y1 = top y3 = h+eps;
  bot y2 = bot y4 = vround 1/3[x_height, h]-eps;
  lft x4 = hround 2.25u; rt x1 = w-hround 1.5u;
  x1-x3 = x2-x4 = hround 3u;
  draw z1{x2-x1, 2(y2-y1)}..z2;
  draw z3{x4-x3, 2(y4-y3)}..z4;
  labels(1, 2, 3, 4);
endchar;

beginchar("@", 15u#, asc_height#, 0);
  "The at sign";
  italcorr 0.7asc_height#*slant-0.5u#;
  adjust_fit(0, 0);
  pickup lower_cal.nib;
  top y1 = 0.75h+eps; bot y3 = vround 0.25h-eps; y4 = 0.333[y3, y5];
  top y5 = h+o; y6 = 0.5[y5, y7]; bot y7 = -o; y8 = good.y 0.15h;
  y2 = 0.2[y3, y1];
  rt x4 = rt x8 = w-hround u+eps; lft x6 = hround u-eps;
  x5 = x7 = 0.5[x4, x6];
  x1 = x2 = good.x(0.7[x6, x4]); x3 = 0.333[x2, x4];
  draw z1..z2 down_to_right z3 right_to_up z4 up_to_left z5
  left_to_down z6 down_to_right z7...z8;
  %
  y9b = good.y(0.73[y7, y5]); y9d = good.y(0.27[y7, y5]);
  0.5[y9b, y9d] = y9a = y9c;
  y9a-y9e = 0.4*(y9b-y9e);
  x9a = x1; x9c = good.x 0.71[x4, x6];
  x9b = x9d = 0.5[x9a, x9c];
  draw z9a up_to_left z9b...z9c down_to_right
  z9d right_to_up z9a;
  labels(1, 2, 3, 4, 5, 6, 7, 8, 9a, 9b, 9c, 9d);
  math_fit(0, 0);
endchar;

skewchar=oct"060"; skew#=.5u#;

ligtable cal_reverse_apostrophe: cal_reverse_apostrophe=: cal_opening_quotes;
ligtable cal_apostrophe: cal_apostrophe=: cal_closing_quotes;
ligtable "!": cal_reverse_apostrophe =: call_spanish_shriek;
ligtable "?": cal_reverse_apostrophe =: call_spanish_query;
ligtable "<": "<" =: call_laquo;
ligtable ">": ">" =: call_raquo;

ligtable "-" : "-"  =: oct"173";
ligtable oct"173" : "-"  =: oct"174";

ligtable "I": "T": "V": skewchar kern skew#;
ligtable "D": "R": "U": "W": "Y": skewchar kern 3skew#;
ligtable "E": "G": "O": "Q": skewchar kern 4skew#;
ligtable "B": "C": "L": "S": "X": "Z": skewchar kern 5skew#;
ligtable "J": skewchar kern 6skew#;
ligtable "A": skewchar kern 7skew#;

ligtable "F": skewchar kern 4skew#, 
"a" kern -2u#, "e" kern -2u#, "o" kern -2u#, "r" kern -u#;

ligtable "H": skewchar kern 4skew#, 
"a" kern -u#, "e" kern -u#, "o" kern -u#;

ligtable "K": skewchar kern 2skew#,
"a" kern -u#, "e" kern -u#, "o" kern -u#;

ligtable "M": skewchar kern 5skew#, 
"a" kern -u#, "e" kern -u#, "o" kern -u#, "r" kern -u#;

ligtable "N": skewchar kern 3skew#, 
"a" kern -u#, "e" kern -u#, "o" kern -u#;

ligtable "P": skewchar kern 3skew#,
"a" kern -u#, "e" kern -u#, "o" kern -u#;

ligtable "f": "a" kern -0.5u#, "e" kern -0.5u#, "o" kern -0.5u#;
ligtable "h": "m": "n": "t": "x":
"a" kern -0.25u#, "e" kern -0.25u#, "o" kern -0.25u#, 
"d" kern -0.25u#, "g" kern -0.25u#, "q" kern -0.25u#;
ligtable "o": "x" kern -0.25u#;

endinput.